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

[Solved] Why Can't I Tween This GUI Frame Even Though I Used The Tween Specificaly For GUI Frames?

Whenever I use this code

game.ReplicatedStorage.StandStuff.TweenGui.OnClientEvent:Connect(function(gui,t)	
	
	local guii = script.Parent.Template:Clone()
	guii.Name = gui
	guii.Visible = true
	guii.Text.Text = gui
	local twn = 	guii.TweenFrame:TweenSize(UDim2.new(0,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.		Quad,t)
	wait(t)
	guii:Destroy()
end)

an error comes out and says

 19:57:16.452  Can only tween objects in the workspace  -  Client - LocalScript:7

Even thought i used the tween event for gui frames

1 answer

You forgot to add the parent of the clone So make sure to add this

guii.Parent = script.Parent

And it should look like this

game.ReplicatedStorage.StandStuff.TweenGui.OnClientEvent:Connect(function(gui,t)	
	
	local guii = script.Parent.Template:Clone()
	guii.Parent = script.Parent
	guii.Name = gui
	guii.Visible = true
	guii.Text.Text = gui
	
	local twn = guii.TFrame:TweenSize(
		UDim2.new(0,0,1,0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Quad,
		t,
		false
	)
	
	print(twn)
	wait(t)
	guii:Destroy()
end)

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