• Darkrp - How do i make this...
    9 replies, posted
I wanna make an entity that when a person walks out of it it unarrests them for the jail so people get get broken out [editline]21st August 2014[/editline] no one has any ideas?
[CODE]function Unarrester() for dick,ply in pairs(player.GetAll()) do if ply:isArrested() && ply:GetPos():Distance(ent:GetPos()) =< 30 then // variable ent is your entity ofc ply:Unarrest() end end end hook.Add("Think", "There are possibly better hooks to use", Unarrester)[/CODE] Not sure if this will work, i did not test it but u should give it a try
it doesn't but thx anyway
[url]http://facepunch.com/showthread.php?t=1415391[/url]
that helped but it wont work, i did what it said then posted this code in a serversided file: [lua]eTrigger.Register("TriggerName", { posMin = Vector(-1430.6812744141, 68.413238525391, -195.96875), posMax = Vector(-1434.3951416016, 130.41278076172, -48.03125), playerOnly = true, touch = function( ply ) If ply:isArrested() then ply:Unarrest() end })[/lua]
You are missing an end, it should look like this [lua]eTrigger.Register("TriggerName", { posMin = Vector(-1430.6812744141, 68.413238525391, -195.96875), posMax = Vector(-1434.3951416016, 130.41278076172, -48.03125), playerOnly = true, touch = function( ply ) If ply:isArrested() then ply:Unarrest() end end })[/lua]
To get the vector positions yourself, type getpos in console.
still dont work but thx anyway [editline]25th August 2014[/editline] and i already have the vertor positions
[code] eTrigger.Register("TriggerName", { posMin = Vector(-1430.6812744141, 68.413238525391, -195.96875), posMax = Vector(-1434.3951416016, 130.41278076172, -48.03125), playerOnly = true, touch = function( ply ) if SERVER then if ply:isArrested() then ply:unArrest() end end end }) [/code] Don't know if this will work, as I copied the people from above, but I changed the ply:unarrest to ply:unArrest(), as that's darkRP's player unarrest function now. Also added if SERVER then because ply:unArrest() is a server side function.
THE KILLER IT WORKS THANK YOU SOOOOOO MUCH!!!!!!
Sorry, you need to Log In to post a reply to this thread.