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

Two scripts, need some help?

game.Players.PlayerAdded:connect(function(player)
		player.LocalPlayer.CharacterAdded:connect(function(Character)
			while not player.Character do wait() end
	local character = player.Character
	character.Head.Decal.Texture = 'http://www.roblox.com/asset/?id=135269441'
	character.Head = BrickColor.new.Red()
			end)
end)

This one, I want when the player joins, for their face(Decal) to change to the one I have above. And I want the headcolor to change. Why is it not working?

game.Players.PlayerAdded:connect(function(player)
	player.LocalPlayer.CharacterAdded:connect(function(Character)
	while not player.Character do wait() end
	local character = player.Character
	local animateScript = character.Animate
	animateScript.idle.Animation1.AnimationId = 'http://www.roblox.com/asset/?id=277780651'
end)

end)

This one, it DID work. But it only worked when the player joined the game, if you died or respawned, the animation didn't play. So I tried to fix that by adding CharacterAdded and it did not work anymore at all. Please help?

6 comments

0

'player.LocalPlayer' Do you even know what LocalPlayer IS? Look this stuff up, you have a lot of mistakes

1

Yes.. I do, why'd you have to be rude about it? Do you hate new scripters or something?

0

I just hate it when people don't do any research. http://wiki.roblox.com/index.php?title=LocalPlayer

0

I told you I know what it is already. Why are you showing me this for?

0

You're using it totally wrong, read the article. Unless the problem is the PlayerAdded event, in which case this might be a good idea to look at: http://wiki.roblox.com/index.php?title=PlayerAdded

0

1 answer

I don't know about 2nd script cause I don't do animations but you had multiple errors on the first one and I've fixed it for you. Here's the Fixed script:

game.Players.PlayerAdded:connect(function()
local Player = game:GetService'Players'.LocalPlayer        
Player.CharacterAdded:connect(function()
            while not Player.Character do wait() end
    local character = Player.Character
    character.Head.Decal.Texture = "http://www.roblox.com/asset/?id=135269441"
    character.Head.BrickColor = BrickColor.new("Really red")
            end)
end)

3 comments

0

Thanks but can you please tell me what I did wrong? I'd like to learn from my mistakes.

0

Btw your script didn't work either.

0

Oh, Meh I'm Lazy, Plus Idk why it didn't.

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