jeez mb sir my last reply ehhh
No I dont think so. With the script i sent in the first message here it worked
If I read the topicâs purpose, your script kept killing the player on a loop because of the CharacterAdded.
Just take your script, maybe twist it a bit and remove CharacterAdded?
game.Players.PlayerAdded:Connect(function(Player)
game.Players.RespawnTime = 0.2
local char = Player.Character
char:WaitForChild("Head"):Destroy()
end)
Yea but i want that it only happens 1 time and after 20 secs
In that case, have a 20 second delay.
game.Players.PlayerAdded:Connect(function(Player)
game.Players.RespawnTime = 0.2
local char = Player.Character
task.delay(20, function()
char:WaitForChild("Head"):Destroy()
end)
end)
--I consider it good practise to define the services you use
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
print("Player Added!")
Players.RespawnTime = .2 --this can be moved outside the function
--keep in mind, their character may load before the script runs
local Character = player.Character or player.CharacterAdded:Wait()
--waiting for a maximum of 5 seconds, without yielding the script
local Head = Character:WaitForChild("Head", 5)
task.wait(4) --so it can be seen
if Head then
--I had to use Character.Head instead of Head(no idea why)
Character.Head:Destroy()
end
end)
This wont work for some reason
Itâll just remove the head
Fixed it, for some reason Character:WaitForChild("Head", 5)
wasnât returning the actual head instance.
This isnât my topic but Iâve already told the topic creator the exact same answer:
game.Players.PlayerAdded:Connect(function(Player)
task.delay(20, function()
Player.Character:WaitForChild("Head"):Destroy()
end)
end)
game.Players.PlayerAdded:Connect(function(Player)
game.Players.RespawnTime = 0.2
local Character = Player.Character or Player.CharacterAdded:Wait()
Character:WaitForChild("Head"):Destroy()
end)
Man please read the replies Iâve sent before sending the exact same thing Iâve sent
It doesnât reset my character.
Just do this. It works fine for me?
game.Players.PlayerAdded:Connect(function(Player)
task.delay(20, function()
Player.Character.Head:Destroy()
end)
end)
game.Players.PlayerAdded:Connect(function(player)
print('Player Added !')
local char = player.Character or player.CharacterAdded:Wait()
player:LoadCharacter()
wait(5)
char.Head:Remove()
end)
Doesnât work for me. Donât mind the character reset at the start, thatâs from another script.
I donât see any problem???
Are you even waiting 20 seconds
Also where did you put the script?
You donât see a problem? Itâs not resetting, thats the problem
I waited 20 seconds yes.
Workspace, like I mentioned above.
Try putting a print in the PlayerAdded function and check if it prints or not
Doesnât work for me. Idk why