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

Why isn´t my Gui Moving To the Position?

Asked by 5 years ago

So, im trying to make kind of an intro to my game with a gui, but it isn't moving and idk why. Here's my script:

local player = game.Players.LocalPlayer
local clone = game.ReplicatedStorage.StartGui:Clone()
clone.Parent = player.PlayerGui
player.PlayerGui.ScreenGui.TextLabel.Castle:TweenPosition(UDim2.new(0.33, 0, 0.237, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce)

Help?

0
for starters, the one in replicated storage is named"StartGui" and you are looking for"ScreenGui" in the playergui  theking48989987 2147 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You're cloning the GUI to the wrong location. The GUI should be parented under ScreenGUI not next to it (assuming that StartGui is something other than a ScreenGUI):

local player = game.Players.LocalPlayer
local clone = game.ReplicatedStorage.StartGui:Clone()
clone.Parent = player.PlayerGui.ScreenGui -- First fix
player.PlayerGui.ScreenGui.StartGui.TextLabel.Castle:TweenPosition(UDim2.new(0.33, 0, 0.237, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce) -- Second fix
Ad

Answer this question