I want to make a script that resets people when they join.
For me I want it to work after a certain amount of time, like 2 seconds.
Thank you.
I want to make a script that resets people when they join.
For me I want it to work after a certain amount of time, like 2 seconds.
Thank you.
local TIME = 2
game.Players.PlayerAdded:Connect(function(Player)
repeat wait() until
game.Workspace:FindFirstChild(Player.Name)
wait(TIME)
Player.Character:WaitForChild("Humanoid"):TakeDamage(100)
end)
put in a server script
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Char)
task.wait(2)
Player:LoadCharacter()
end)
end)
I believe they just wanted the action to occur once when the player first joins.
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
task.delay(2, player.LoadCharacter, player)
end)
I know its 3 years later but would it break the script if I were to change the task.delay to maybe 1 or below?