• No Collide Problem
    0 replies, posted
  • Avatar of Blt950
  • Hi guys! I got a problem regarding my script. It's a script that finds these barriers entities, and makes it not collideable for CP's and so on. They are also toggable, so that's why I've this GetNWBool here too, to check that. The problem here is, that the entity spawns completly fine. But if you pass it many times, around 5-15 times (walking or running though the prop). Suddently all props "floats" on the surface, like the ground over whole map was a sea (kinda). I know there is something in this nocollide script that messes up. But I don't know why and what. As I don't even get any error message. Thanks for helping! [lua] local function ShouldCollideTestHook( ent1, ent2 ) shields = {"combine_barrier", "combine_barrier2", "combine_barrier3", "combine_barrier4", "combine_barrier5"} if table.HasValue(shields, ent1:GetClass()) or table.HasValue(shields, ent2:GetClass()) then if ent1:IsPlayer() or ent2:IsPlayer() then local shield local player if table.HasValue(shields, ent1:GetClass()) then shield = ent1 elseif table.HasValue(shields, ent2:GetClass()) then shield = ent2 end if ent1:IsPlayer() then player = ent1 elseif ent2:IsPlayer() then player = ent2 end // Collide shit aTeams = {"Overwatch Solider", "Metropolice Unit", "Elite Metropolice", "Metropolice Recruit", "Elite Overwatch Solider", "Administrator"} if player:IsValid() and player:GetActiveWeapon():GetClass() != "weapon_physgun" and !player:GetSharedVar("fallenOver") then -- Made it collideable so you can phys it. if shield:GetNWBool("shieldon") and not player:KeyDown(IN_USE) then if table.HasValue(aTeams, team.GetName(player:Team())) then return false end elseif not player:KeyDown(IN_USE) then return false end end end end end hook.Add( "ShouldCollide", "ShouldCollideTestHook", ShouldCollideTestHook ) [/lua]