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

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

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)

1 comment

0

If you are holding the tool in your hand, the tool is not in your backpack. Instead it is in your player character.

2 answers

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

1 comment

0

And how do i fix that ?

@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

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