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

I need my script to Tween a frames position after a time that is set, whats wrong?

Asked by 6 years ago

My code for making this frame tween to a new position after 10 seconds wont work, whats wrong with it?

wait(10)


game.StarterGui.LoadingScreen.Frame.Frame:TweenPosition(UDim2.new(0.845, 0, 0.45, 0))

1 answer

Log in to vote
0
Answered by 6 years ago

What you need to understand is what starter gui is. When a player spawns, whatever is in startergui gets put into their "PlayerGui"... If I understand correctly, you want to move the frame 10 seconds after they spawn. In that case, the code would look like this:

--This is a LOCAL script under StarterGui. If  the gui is only there when the player FIRST enters the game, put this in StarterPlayer scripts
wait(10)
game.Players.LocalPlayer.PlayerGui:WaitForChild("LodingScreen"):WaitForChild("Frame"):WaitForChild("Frame"):TweenPosition(UDim2.new(0.845, 0, 0.45, 0))
0
Didnt work DarkAssasin0 0 — 6y
Ad

Answer this question