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

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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)
Ad

Answer this question