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

Why does tweening this make it look goofy?

Asked by 8 years ago

II cannot get this gui to tween properly.

Error in output: Can only tween objects in the workspace (line 26)


local sign = script.Parent local click = sign.ClickDetector click.MouseHoverEnter:connect(function(player) print("Hovered") local signgui = Instance.new("BillboardGui",script.Parent) signgui.Size = UDim2.new(4,0,2,0) signgui.SizeOffset = Vector2.new(-0.5,3) signgui.AlwaysOnTop = true local signgui1 = Instance.new("TextLabel",signgui) signgui1.Size = UDim2.new(2,0,2,0) signgui1:TweenPosition(UDim2.new(-0.5,0,-3,0), "In", "Quad", 3) wait(0.5) signgui1:TweenPosition(UDim2.new(0.5,0,3,0), "Out", "Quad", 3) signgui1.Text = "Welcome, " .. player.Name .. ", to Land of Guardia by Nathen35." signgui1.TextScaled = true signgui1.TextWrapped = true click.MouseHoverLeave:connect(function(player) signgui1:TweenPosition(UDim2.new(-0.5,0,-3,0), "In", "Quad", 2) wait(3) signgui:Destroy() end) end)
0
Can you provide both the error for the given code above (line 26 is a wait) and have you tried putting it in the workspace? EgoMoose 802 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

MouseHoverLeave is still connected, even though you destroy signgui. This means that when you move your mouse off again, you lose.

Ad

Answer this question