if Player.UserId == 3081295884 then
print("Player found. Hello, WolfieGamerYT!")
local SpeedTool = ServerStorage.SpeedTool:Clone()
SpeedTool.Parent = Player.Backpack
print("tool given")
local leaderstats = Player:WaitForChild("leaderstats")
leaderstats.Coins.Value = 1000000
leaderstats.Gems.Value = 1000000
else
local Humanoid = Character:WaitForChild("Humanoid")
while task.wait(1) do
Humanoid:TakeDamage(5)
if Humanoid.Health == 0 then
Player:Kick("Begone!")
break
end
end
end
end)
end)
It’s not working because while task.wait(1) do keeps executing forever, and it never gets to the next part. I would reccomend setting up a Humanoid.Died:Connect(function()) before you start the while loop.
local PlayerService = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
PlayerService.PlayerAdded:Connect(function(Player)
if Player.UserId == 0000000000 --[[USER ID HERE]] then
local SpeedTool = ServerStorage.SpeedTool:Clone()
SpeedTool.Parent = Player.Backpack
local Stats = Player:WaitForChild("leaderstats")
Stats.Coins.Value = math.huge
Stats.Gems.Value = math.huge
else
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
Player:Kick("Be gone!")
end
while task.wait(1) do
Humanoid:TakeDamage(5)
end
end
end