So I wanna tween GUI's for my game and for some reason I cannot get it to work. I am using a local script as well.
local button = script.Parent local frame = game.StarterGui.Test.Frame button.MouseButton1Click:connect(function() print("Hello") frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), 'Out', 'Bounce', 1) end)
This is my code so far. Can someone maybe help me on this?
Thanks.
You're changing the StarterGui rather than the PlayerGui. Whatever is changed in StarterGui will not replicated until you respawn.
Use the LocalPlayer value of game.Players since you're using a LocalScript and set Frame's TweenPosition through the PlayerGui of the player.
local button = script.Parent local frame = game.Players.LocalPlayer.PlayerGui.Test.Frame --All I did was change the variable so the LocalPlayer which can only be achieved in a LocalScript can be found through the Players Service and have the script go into the PlayerGui object of the LocalPlayer. button.MouseButton1Click:connect(function() print("Hello") frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), 'Out', 'Bounce', 1) end)