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

Suitcase is not a valid member of Player? WAT

Asked by 8 years ago

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

0
0
You're checking inside the player instance, not the player's character. Change it to: `local bag = character.Suitcase'. PowerHotmail123 90 — 8y
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. Perci1 4988 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

In simplicity, change this:

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

to this:

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

Answer this question