cubez = {"xXUltraAltraXx","Player"} cubeceiling.Touched:connect(function(hit) for i,v in pairs(cubez) do if (string.upper(hit.Parent.Name) == string.upper(v)) then hit.Parent.Humanoid.Health = 100 elseif hit.Name == "abcdefgzyxwvut" or hit:IsA"BasePart" then if hit.Velocity ~= Vector3.new(0,0,0) then hit.CanCollide = true hit.Velocity = Vector3.new(0,0,-2500) end end end end)
Uh ignore the cubeceiling lol but yeah it dosent work im trying to make it so anyone in the table dosent get flung lol please help
The problem is that the players name must be equal to every element in the array or they will get "flung".
cubez = {"xXUltraAltraXx","Player"} cubeceiling.Touched:connect(function(hit) local InTable = false for i,v in pairs(cubez) do if (string.upper(hit.Parent.Name) == string.upper(v)) then InTable = true end end if InTable then hit.Parent.Humanoid.Health = 100 elseif hit.Name == "abcdefgzyxwvut" or hit:IsA"BasePart" then if hit.Velocity ~= Vector3.new(0,0,0) then hit.CanCollide = true hit.Velocity = Vector3.new(0,0,-2500) end end end)