Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Two scripts, need some help?

Asked by 9 years ago
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?

0
'player.LocalPlayer' Do you even know what LocalPlayer IS? Look this stuff up, you have a lot of mistakes Perci1 4988 — 9y
1
Yes.. I do, why'd you have to be rude about it? Do you hate new scripters or something? james24dj 90 — 9y
0
I just hate it when people don't do any research. http://wiki.roblox.com/index.php?title=LocalPlayer Perci1 4988 — 9y
0
I told you I know what it is already. Why are you showing me this for? james24dj 90 — 9y
View all comments (2 more)
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 Perci1 4988 — 9y
0
I got help from Roblox.Wiki with these scripts. http://wiki.roblox.com/index.php?title=Changing_default_character_animations james24dj 90 — 9y

1 answer

Log in to vote
0
Answered by
KenzaXI 166
9 years ago

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)

0
Thanks but can you please tell me what I did wrong? I'd like to learn from my mistakes. james24dj 90 — 9y
0
Btw your script didn't work either. james24dj 90 — 9y
0
Oh, Meh I'm Lazy, Plus Idk why it didn't. KenzaXI 166 — 9y
Ad

Answer this question