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

Welcome is not a valid member of PlayerGui?

debounce = false

script.Parent.Touched:Connect(function(hit)
if debounce == false then
if hit.Parent:FindFirstChild("Humanoid") then
Character = hit.Parent
Player = game.Players:GetPlayerFromCharacter(Character)
if Player.Backpack:FindFirstChild("Ticket") then
debounce = true
script.Parent.CanCollide = false
Welcome = Player.PlayerGui.Welcome
Welcome.Frame:TweenPosition(UDim2.new(.158,0,.767,0), 'Out', 'Back')
wait(5)
Welcome.Frame:TweenPosition(UDim2.new(.158,0,1.7,0), 'In', 'Back')
wait(1.5)
script.Parent.CanCollide = true
debounce = false
else 
TicketError = Player.PlayerGui.Ticket
TicketError.Frame:TweenPosition(UDim2.new(.158,0,.767,0), 'Out', 'Back')
wait(5)
TicketError.Frame:TweenPosition(UDim2.new(.158,0,1.7,0), 'In', 'Back')
end
end
end
end)

Whenever I run this script, I get an error saying that Welcome is not a valid member of PlayerGui. Welcome is in the StarterGui, so I can’t think of any issues it would run in to

1 comment

0

Also sorry about no indentation!

1 answer

✓ Accepted answer

You are trying to access the ScreenGui from a server script. ScreenGuis cloned from StarterGui to PlayerGui are not replicated to the server, therefor you cannot use them from a server script.

You need to either use RemoteEvents to tell the client when to tween the gui or clone the gui from a server script into the PlayerGui, then it will be accessible by server, although it's a less recommended way.

1 comment

0

Thought that might have been the issue, but I read somewhere it wasn’t necessary. Clearly misinformed. Thanks :)

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