I wrote a TweenPosition script to open a Gui. It works perfectly fine when I start a Server on Studio, but when I disconnect from Studio and just play the game, it doesn't work at all. It's not giving me anything in the F9 console either. Help? It's in a regular Script, here's the code.
StatsBG = script.Parent.Parent.Parent.StatsBG
function open()
if StatsBG.Visible == false then
StatsBG.Visible = true
StatsBG.Position = UDim2.new(0,545,0,-400)
StatsBG:TweenPosition(UDim2.new(0,545,0,60), "In", "Quart", 1)
else
StatsBG.Visible = true
end
end
script.Parent.MouseButton1Down:connect(open)

6 comments
I tried that, now it's giving me the error "StatsBG is not a valid member of ScreenGui" when I JOIN the game, not click the button.
Send me a pic of the hierarchy.
Don't use local scripts, supposedly that's how most Roblox games are being hacked.
Also do MouseButton1Click, MouseButton1Down is kind of bad because a player could click and hold and he doesn't have to release his mouse for it to work. MouseButton1Click makes it so when they release there mouse it works.
Hierarchy: http://gyazo.com/9215df7b8bfefea59a2ca9595cc01178
Fixed it myself. Thanks though.