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

How to make a tool equip delay?

Asked by 3 years ago
Edited 3 years ago

So ive been working on a tool and i want the tool to come out as soon as the animation is done(3 seconds) and I tried using wait at the top of the code but that didin't work anybody have any idea on how to fix this?





wait(3) function Weld(x,y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end function Get(A) if A.className == "Part" then Weld(script.Parent.Handle, A) A.Anchored = false else local C = A:GetChildren() for i=1, #C do Get(C[i]) end end end function Finale() Get(script.Parent) end script.Parent.Equipped:connect(Finale) script.Parent.Unequipped:connect(Finale) Finale()

1 answer

Log in to vote
0
Answered by 3 years ago

Greetings!

One of the things you can do is, have a debonce variable that determines whether your tool can be used or not, every time your tool is equipped, an animation will play to represent you equipping it, then, once the animation is complete you make the debounce true and allow the tool to be used.

0
Sorry Im a begginer what exactly is a denounce value? Iownrobloxp 44 — 3y
Ad

Answer this question