So I tried making this to check if there is a boolean called "AFK" in the player so they don't get the bool value in their player twice. but, this doesn't work.
game.Players.PlayerAdded:connect(function(player) FindBool = player:FindFirstChild("AFK") player.CharacterAdded:connect(function(character) if FindBool == false then Instance.new("BoolValue",player) player.Value.Name = "AFK" character.Humanoid.WalkSpeed = 0 else end end) end)
Put this in a ServerScript
game.Players.PlayerAdded:connect(function(player) local already = false player.CharacterAdded:connect(function(character) for i,v in pairs(player:GetChildren()) do if v.Name=="AFK" then already=true end end if not already then local afk=Instance.new("BoolValue",player) afk.Name="AFK" end end) end)