Lamino961
(Lamino961)
September 8, 2023, 3:14pm
#1
and so hello everyone, I would like to add animation delay, I can’t add it myself because the script is not my level
local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://14717519545"
local track
tool.Activated:Connect(function()
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = false
track:Play()
wait(1)
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)
Lamino961
(Lamino961)
September 8, 2023, 3:32pm
#2
please help kind people please any help will be useful help to fix this damn script already
Do do this add a task.wait() at the beginning of the activation function, not the end.
I improved a few other parts of your script as well:
local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://14717519545"
local track
tool.Activated:Connect(function()
task.wait(desired_delay_time)
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = false
track:Play()
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)
Basically the big thing I changed is I changed wait() to task.wait(). It is a more performance friendly method of yielding scripts.
Congrats on beginning your scripting journey!
Lamino961
(Lamino961)
September 8, 2023, 4:19pm
#5
I want to add an animation delay, otherwise it will quickly release it.
hey man, you need to put your delay time like, task.wait(1) or task.wait(“1”)
1 Like
Lamino961
(Lamino961)
September 8, 2023, 4:20pm
#7
I want to add an animation delay, otherwise it will quickly release it. pls help me
how much delay do you want? like how many seconds?
Lamino961
(Lamino961)
September 8, 2023, 4:25pm
#9
2 seconds will be enough it will be very good
so try this:
local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://14717519545"
local track
tool.Activated:Connect(function()
wait(2) -- DELAY TIME 2 SECONDS YOU CAN CHANGE IT
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = false
track:Play()
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)
system
(system)
Closed
September 22, 2023, 4:28pm
#11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.