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

CharacterAdded is not a valid member of RBXScriptSignal?

Asked by 6 years ago

ive been looking for answers for this error ive tried: player.Character:wait(), player.CharacterAdded:wait()

full script:

player = game.Players.PlayerAdded
char = player.CharacterAdded    
Humanoid = char:WaitForChild('Humanoid')

script.Parent.Equipped:connect(function()
    local stance = Humanoid:LoadAnimation(script.Parent.Stance)
end)

the error 'Character is not a valid member of RBXScriptSignal' is on line 2: char = player.CharacterAdded

im tired this is probably a dumb mistake

-thanks

0
You're really indexing game.Players.PlayerAdded.CharacterAdded with your first two lines. Try actually connecting to these events? XAXA 1569 — 6y
0
nope same error TigerClaws454 48 — 6y
1
Try "game.Players.PlayerAdded:wait()" and "player.CharacterAdded:wait()" RockerCaleb1234 282 — 6y
0
Also, use local variables instead of global ones. Simply put "local" in front of your "player", "char", and "Humanoid" variables. GoldenPhysics 474 — 6y
0
what is the difference? TigerClaws454 48 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Do this instead:

game.Players.PlayerAdded:connect(function(player) --name "player" to whatever you want
    player.CharacterAdded:connect(function(char) --name "char" to whatever you want
        local humanoid = char:WaitForChild("Humanoid")
        script.Parent.Equipped:connect(function()
            local stance = humanoid:LoadAnimation(script.Parent.Stance)
        end)
    end)
end)

If you wanted to define player at the beginning like blah = blah, then put it in a local script and define player as localplayer. But this way is easier. Accept if this worked for you!

Ad

Answer this question