I'm trying to tween 2 GUIs when a player joins, But it doesn't seem to be working.
wait (4) local function Tween() local Frame = script.Parent Frame['Text']:TweenPosition(UDim2.new(0.45, 0, 0.4, 0), "In" , "Quad", 0.5) Frame['Pic']:TweenPosition(UDim2.new(0.35, 0, 0.4, 0), "In" , "Quad", 0.5) end game.Players.PlayerAdded:connect(Tween)
There's no outputs but nothing seems to be moving either..
(Text and Pic are named this and are in script.Parent
)
Thanks for your help :)
You're waiting 4 seconds before the script does anything, by then the first player will have joined and loaded. It seems to me like you're using a script in a ScreenGui so using the PlayerAdded connection will make it move every time a player joins the game. You need to have a script in workspace that clones the ScreenGui into the player's PlayerGui. You would need to create a script in workspace with the ScreenGui in it, the script would look something like this:
game.Players.PlayerAdded:connect(function(plr) -- When a new player is added do the code below wait() gui = script.GUIName:Clone() -- Clone the ScreenGui gui.Parent = plr.PlayerGui -- Set the ScreenGui's parent the new player's PlayerGui gui.Text:TweenPosition(UDim2.new(0.45,0,0.4,0),"Out","Quad",2) -- Tween the Text gui.Pic:TweenPosition(UDim2.new(0.35,0,0.4,0),"Out","Quad",2) -- Tween the Picture wait(5) -- Time before ScreenGui is removed. gui:remove() -- Remove the ScreenGui end)
If this works please accept this answer and vote it up!
Someone helped me with a tween before, it looked something like this(using your code):
Frame.Parent['Frame'].Text:TweenPosition(UDim2.new(0.45, 0, 0.4, 0), "In" , "Quad", 0.5, true)
Maybe that will work.
Then do the same with the Picture:
Frame.Parent['Frame'].Pic:TweenPosition(UDim2.new(0.35, 0, 0.4, 0), "In" , "Quad", 0.5, true)