Ok So I tried to change the name of the Humanoid using this but it wont work?
game.Players.PlayerAdded:connect(function(plr)
Humanoid.Name="Human"
end)
Ok So I tried to change the name of the Humanoid using this but it wont work?
game.Players.PlayerAdded:connect(function(plr)
Humanoid.Name="Human"
end)
The game doesn't know what Humanoid you're talking about, since you didn't write a path to it.
game.Players.PlayerAdded:connect(function(plr)
plr.Character.Humanoid.Name="Human"
end)
However, due to how Roblox's object loading system works, when this code runs the player's Character may not exist yet, leading to an error, so we should throw in a Wait For Child to wait until it does exist to avoid errors:
game.Players.PlayerAdded:connect(function(plr)
plr:WaitForChild("Character").Humanoid.Name="Human"
end)
When I Press Reset the character still Resets?
You cant use WaitForChild in the player for find the character
Actually, you can but the rest of your code will not run because it waitting the child "Character" in the player and it's nil
You weren't referencing the Humanoid correctly, you need to search for it inside the character. You should t use character added for this, so the code runs whenever the character spawns, rather than just once.
game.Players.PlayerAdded:connect(function(player)--whenever a player joins the game, run the following code and return the player
player.CharacterAdded:connect(function(character)--whenever a character tailored to the given player spawns, run the following code and return the character
character:FindFirstChild("Humanoid").Name = "Human"--search for the humanoid inside the given character and rename it "Human"
end)
end)
it works but it stops the animation of the player?
The player script that does the animating references the humanoid in the player by it's name, so yeah, it interferes with other scripts if you rename the humanoid
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
game:service'Players'.Name = 'Something' -- This breaks a ton of crap lol