So, I got this script so that when someone says "Help" they tp to me.
mk = game.Players:GetChildren() for i=1, #mk do mk[i].Chatted:connect(function(Msg) if Msg == "Help" then mk[i].Character.Torso.CFrame = CFrame.new(Workspace.jaytheidiot.Torso.CFrame.X+5,Workspace.jaytheidiot.Torso.CFrame.Y+2,Workspace.jaytheidiot.Torso.CFrame.Z) end end) end
How do I make it so the playerbase is constantly updated? With this only the people who were there when I ran it can use it.
An easy way to fix this is to put the whole thing in an infinite loop. That way, every 0.01 seconds or so it will check the list of players again.
while true do wait() local mk = game.Players:GetChildren() for i=1, #mk do mk[i].Chatted:connect(function(Msg) if Msg == "Help" then mk[i].Character.Torso.CFrame = CFrame.new(Workspace.jaytheidiot.Torso.CFrame.X+5,Workspace.jaytheidiot.Torso.CFrame.Y+2,Workspace.jaytheidiot.Torso.CFrame.Z) end end) end end