Basically, my scenario is: Right when players spawn they get an instant forcefield and it should always be there as long as the player doesn't move. I want to check if the player is not idle anymore to remove the forcefield.
delay(0, function()
for _, Player in next, Players:GetPlayers() do
local Character = Player.Character or Player.CharacterAdded:wait()
Player.Idled:wait()
if Character:FindFirstChild('ForceField') then
Character.Forcefield:Remove()
end
end
end)
My attempt doesn't work

2 comments
Make sure it was a LocalScript.
maybe you can use a if statement that checks the player x or z position