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

Suitcase is not a valid member of Player? WAT

erm, I've been having trouble with this script for a while..

I'm trying to get where, when you click the blue circle on the popup GUI, your Suitcase (named handle) turns to a blue color. The output says this:

Suitcase is not a valid member of Player

Here is the script:

local player = game.Players.LocalPlayer
character = player.Character
local bag = player.Suitcase:WaitForChild("Suitcase"):WaitForChild("Handle")

function onClick()
    bag.BrickColor = BrickColor.new("Bright blue")
end

script.Parent.MouseButton1Click:connect(onClick)

Here is some screenshots

http://prntscr.com/abwtvo

http://prntscr.com/abwu47

3 comments

0
0

You're checking inside the player instance, not the player's character. Change it to: `local bag = character.Suitcase'.

0

The thing in workspace with your name that you walk around with is NOT your player. It's your character. That's why you get the error.

1 answer

In simplicity, change this:

player.Suitcase:WaitForChild("Suitcase"):WaitForChild("Handle")

to this:

character.Suitcase:WaitForChild("Suitcase"):WaitForChild("Handle")

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