Tool Clone Gui isn't working properly

I’m trying to make it like a Tool giver through a GUI. The Tool location is in replicatedStorage. But for some reason when I’m clicking on the TextButton and cloning the tool to the Player.Backpack the animation isn’t working. Can you help me, please? The Script:


local Player = game.Players.LocalPlayer

repeat wait(0.1) until Gui:Clone()

wait(0.2)

Gui.Main:TweenPosition(UDim2.new(0.5, 0, 0.479, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.5)

local Water = game.ReplicatedStorage.Water

Gui.Main.Button2.Btn.MouseButton1Click:Connect(function()

Water:Clone().Parent = Player.Backpack

wait(0.2)

Gui.Main:TweenPosition(UDim2.new(0.5, 0, -1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.5)

wait(0.3)

Gui:Destroy()

end)

You need a tween:play() function.

It’s not the problem the problem is the tool animation isn’t working when being cloned.

1 Like

Are you trying to give the tool inside of a local script?

Yep, the local script is located in a GUI.

Instead, fire a remote event that gives the player the tool/tools.

Fixed, thanks buddy! Replaced the script.