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

Why this error is appearing ? ( i want to put a text on a sign )

Asked by 3 years ago

well i have this error : 20:43:48.419 Sign is not a valid member of Backpack "Players.SamSoGames.Backpack"

here is my script :

script.Parent.MouseButton1Click:Connect(function()
    local backpackplr = game.Players.LocalPlayer.Backpack.Sign
    local textad = script.Parent.Parent.TextAd.Text

    backpackplr.SignPart.SurfaceGui.TextLabel.Text = textad
end)
0
If you are holding the tool in your hand, the tool is not in your backpack. Instead it is in your player character. sergeant_ranger 184 — 3y

2 answers

Log in to vote
0
Answered by
Nozazxe 107
3 years ago

This is because when you hold the tool, it is a part of your player model, not the actual players backpack.

0
And how do i fix that ? SamSoGames 7 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

@Nozaxe is correct. When a tool is equipped it transfers to the player's character. A players character can be retrieved doing of the following:

Player.Character --A direct link to the player's character model

This may also come in handy:

Player.CharacterAdded --An event that fires when the player's character is added

Answer this question