So hey i'm making a mail delivery system in darkrp(Mailman is a job. Basically you put item A in package B(I it works fine.) then put package B into mailbox C(This is where i'm having trouble. I have it set up to where it will use a self.isHolding variable to distinguish between the package having an item, and being empty. I want the player to be able to put the item in the box, then put the box in the mailbox for money. The problem is that I can't get it to ONLY accept the package with something in it. Please, if anyone could help, I'd really appreciate it. If you need to see any of my code: just ask.
Just check if ent.IsHolding is true.
[QUOTE=code_gs;51272897]Just check if ent.IsHolding is true.[/QUOTE]
[CODE]function ENT:StartTouch(ent)
if ent:GetClass() == "package" and self.isHolding == true then
ent:Remove()
end
end [/CODE]
Like that? That's how the init currently looks.
Check if the touching ent IsHolding
[QUOTE=code_gs;51276188]Check if the touching ent IsHolding[/QUOTE]
[CODE]function ENT:Think()
if self.isHolding == true then
self:SetColor(Color(255,0,0))
else
self:SetColor(Color(0,255,0))
end
end
[/CODE]
That the think function on the package
[CODE]function ENT:StartTouch(ent)
if ent:GetClass() == "itemA" and self.isHolding == false then
ent:Remove()
self.isHolding = true
end
end[/CODE]
Thats the touch function to tell the package it's holding an item
Couldnt you make two entities one being blah the other being emptypackage and when blah is touching the empty package create a fullpackage and remove blah and emptypackage. And when fullpackage touches mailbox or c remove fullpackage and give money? Just a guess.
Sorry, you need to Log In to post a reply to this thread.