• I need help with my Antiblocksystem.
    3 replies, posted
[B]I need help with my Antiblockystem[/B] I've tried to make a script which disables the player collision in certain areas. But the problem is i want the players who aren't in these areas to have a normal collision. This is the code i got. [CODE]local nextCheck = CurTime()+2,5 hook.Add("Think","CheckBox",function() if nextCheck <= CurTime() then nextCheck = CurTime()+2,5 local AntiBlockZones = { Spawn = ents.FindInSphere(Vector(-4859, 5375, 164),450), TeleporterA = ents.FindInSphere(Vector(3585, -5631, 256),450), TeleporterB = ents.FindInSphere(Vector(-5632, -5632, 228),450), TeleporterC = ents.FindInSphere(Vector(4926, 9095, 127),450), TeleporterD = ents.FindInSphere(Vector(4447, 10112, 232),450), TeleporterE = ents.FindInSphere(Vector(-4742, 406, 234),450)} for k,zones in pairs(AntiBlockZones) do for k,plyinzone in pairs(zones)do if IsValid(ply) and ply:IsPlayer() and ply:Alive() then plyinzone:SetAvoidPlayers(true) plyinzone:SetNoCollideWithTeammates(true) plyinzone:SetCollisionGroup(11) else for k,ply in pairs(player.GetHumans()) do ply:SetCollisionGroup(0) ply:SetAvoidPlayers(false) ply:SetNoCollideWithTeammates(false) --plyinzone:SetAvoidPlayers(true) --plyinzone:SetNoCollideWithTeammates(true) --plyinzone:SetCollisionGroup(11) end end end end end end)[/CODE] I've commented some of the code, that's because it gives the error nil.
You could create a brush entity for that. [CODE] StartTouch > SetNoCollideWithTeammates(false) EndTouch > SetNoCollideWithTeammates(true) [/CODE] Take a look at this post: [URL]https://facepunch.com/showthread.php?t=1171555&p=35220153&viewfull=1#post35220153[/URL]
[QUOTE=CupCakeR;51917567]You could create a brush entity for that. [CODE] StartTouch > SetNoCollideWithTeammates(false) EndTouch > SetNoCollideWithTeammates(true) [/CODE] Take a look at this post: [URL]https://facepunch.com/showthread.php?t=1171555&p=35220153&viewfull=1#post35220153[/URL][/QUOTE] Is there some other way to do it? Because i really have no glue how to do it that way.
You can enable [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetCustomCollisionCheck]Entity:SetCustomCollisionCheck[/url] on players, then check if they are in the area in [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/ShouldCollide]GM:ShouldCollide[/url]
Sorry, you need to Log In to post a reply to this thread.