I was just trying to make a simple Gui that stays on the screen for 3 seconds, then it Tweens off, but I've been having trouble with getting this to work. I've tried just disabling the visibility to test it, but it only works in studio. Help?
This is a local script in a Screen Gui. The screen Gui contains two image labels that should move off screen when the script is activated.
Here is the code:
local player = script.Parent.Parent
local mainGui = script.Parent
function testFunction()
local folder = mainGui.SplashScreen
local test1 = folder.test1
local test2 = folder.test2
wait(3)
test1:TweenPosition(UDim2.new(-1, 0, 0, -100), "In")
test2:TweenPosition(UDim2.new(1, 0, 0, -100), "In")
end
testFunction()
I'm new to Roblox scripting so I don't know if it's simple or not.
Thanks! -Kyleo

3 comments
Normally when things only work in studio, it's because FE is on. You're also not using LocalPlayer so you must be using a regular script. This all means that the problem is most likely because Scripts can't access PlayerGui when FE is on. Use a local script or turn FE off.
FE was off and it is in a Local script... I'll chance the player to local player though...
Still not working... :/