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

How can I make this waitforchild?

It's a simple script but I can't get it to wait for the player to load up before it starts doing the tween.

local frame = script.Parent

frame:TweenPosition(UDim2.new(.5,0,.55,0), 'Out', 'Bounce', 10)

2 answers

✓ Accepted answer
local player = game.Players.LocalPlayer
if player and player.PlaeyrGui and player.Character then
local frame = script.Parent

frame:TweenPosition(UDim2.new(.5,0,.55,0), 'Out', 'Bounce', 10)
end

This would be better if you wanted it to wait for everything to be in.

repeat wait() until game.Players.LocalPlayer.Character

local frame = script.Parent

frame:TweenPosition(UDim2.new(.5,0,.55,0), 'Out', 'Bounce', 10)

The first line repeatedly waits until the Player is loaded and then executes the rest below.

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