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

Why does tweening this make it look goofy?

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)

1 comment

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?

1 answer

✓ Accepted answer

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

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