Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

CharacterAdded script not working, does anybody knows how to fix?

So I am trying to make a script that when you join it gives you the body parts I put into ServerStorage, I tried the script and it doesn't works, I am not sure what is the error, because there's no output that shows any mistakes, heres the entire code:

print "Script succesfully loaded"
local noob = game.Workspace:FindFirstChild("Humanoid")
local LeftA = game.ServerStorage.LeftArm:Clone()
local LeftL = game.ServerStorage.LeftLeg:Clone()
local RightA = game.ServerStorage.RightArm:Clone()
local RightL = game.ServerStorage.RightLeg:Clone()
local Tor = game.ServerStorage.Torso:Clone()

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		wait(30)
		Tor.Parent = noob
		RightL.Parent  = noob
		RightA.Parent = noob
		LeftL.Parent = noob
		LeftA.Parent = noob
	end)
end)

1 comment

0

Change the title, there is no ChildAdded event.

1 answer

The problem is, FindFirstChild, finds the FIRST child with the name of Humanoid, there is more people in the game also which means there could be up to 5 humanoids, so it didn't work since it's targeted to only finding 1 humanoid. So try this:

print"Script succesfully loaded"
local LeftA = game.ServerStorage.LeftArm:Clone()
local LeftL = game.ServerStorage.LeftLeg:Clone()
local RightA = game.ServerStorage.RightArm:Clone()
local RightL = game.ServerStorage.RightLeg:Clone()
local Tor = game.ServerStorage.Torso:Clone()

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        wait(30)
        Tor.Parent = character
        RightL.Parent  = character
        RightA.Parent = character
        LeftL.Parent = character
        LeftA.Parent = character
    end)
end)

If you want to make the parts go into the humanoid, replace character with character.Humanoid,


Hope it helps! Tell me if it doesn't work.

2 comments

0

Nice answer, bro!

0

It does! Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.