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

Character is not a valid member of ScreenGui??

So i'm trying to make this morph GUI but everytime i fix an error i get a new one and im really stumped, what am i doing wrong?

Player = script.Parent.Parent.Parent
Me = Player.Character or Player.CharacterAdded:wait()
local Morphs = script.Parent.Morphy:GetChildren()
script.Parent.MouseButton1Click:connect(function(r)

2 comments

0

Please include what type of script it is and where it is located.

0

It's a Local Script and its located in a GUI in a Frame and in an Image Button

2 answers

✓ Accepted answer

If you're running in a localscript, which you should be if it's a child of a Gui, you can use game.Players.LocalPlayer I would recommend you use a localscript under the Gui which fires a remote whenever you need server access.

You forgot the "local" before Player and Me. Here's the fixed script.

local Player = script.Parent.Parent.Parent
local Me = Player.Character or Player.CharacterAdded:wait()
local Morphs = script.Parent.Morphy:GetChildren()
script.Parent.MouseButton1Click:connect(function(r)

Please reply if it worked and mark it as the answer.

Thanks.

4 comments

0

Nope still doesn't work.

0

Wouldn't make any difference except for making the variables local

0

Anything printing in the client? (Press F9, check if anything is there)

0

It's just saying " Character is not a valid member of ScreenGui" and "Script 'Workspace.Part.CostumeGui.Frame.1.Script', Line 5" which is the line that is having the issue.

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