Hi guys! I still haven't got this working - I want to check if the thing touching the brick is player and then if it is, carry on with the rest of the script to put them in a table.... but for some reason, it's still not working :( Any help would be greatly appreciated :) Thanks in advance!!
script.Parent.Touched:connect(function(hit) print ("Player touched!") if hit.Parent:FindFirstChild("Humanoid") then for key, value in next, _G.Escapers do if value == hit.Parent.Name then return end end end table.insert(_G.Escapers, hit.Parent.Name) end);
Not positive. Haven't worked with _G tables or functions, but I think I know the problem.
Try this
while _G.Escapers == nil do --Might've needed a wait for variable. wait() end script.Parent.Touched:connect(function(hit) print ("Player touched!") if hit.Parent:FindFirstChild("Humanoid") then for key, value in pairs (next, _G.Escapers) do --Might've need that pairs. if value == hit.Parent.Name then return end end end table.insert(_G.Escapers, hit.Parent.Name) end);
But then again, first time after doing some research.