#how do i make a tool script that plays the animation after u activate it
76 messages · Page 1 of 1 (latest)
like u hold the tool, then click screen
ok
give me a secccccccc
give me a sec
its a local
uh k
local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=" -- here you anim id
local track
tool.Equipped:Connect(function()
tool.Activated:Connect(function()
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = false
track:Play()
end)
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)
mk
i think that should work
should that be a normal script, local ect
why ur setting Looped to false and priority to action if he can do it himself
when uploading animation
and
idk, i used a gun that i already made
i don't understand this 2 strokes
tool.Activated won't work if tool is unequipped
like this ?
yes, because the title says to play it if the tool is equipped
wait
.
..
?
??????????????????????????????????????????????
@fading mica , do you want to play the anim if you even have the tool unequipped?
yea
ok
😭
local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=" -- here you anim id
local track
tool.Activated:Connect(function()
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track:Play()
end)
like that??
idk if that works
does it work?
let me test rq
ok
i was sending it to make sure it was right
ok ok
local tool = script.Parent
local hu = tool.Parent.Parent:WaitForChild('Humanoid')
local debounce = false
local debounceCD = 2 -- change to ur number
tool.Activated:Connect(function()
if debounce == false then
debounce = true
local anim = Instance.new("Animation")
anim.AnimationId = "rbxasset://ID" -- here your anim id
hu:LoadAnimation(anim):Play()
task.wait(debounceCD)
anim:Destroy()
debounce = false
end
end)
nope

** You are now Level 5! **
trying rn
i can make a mistake
nope
output errors
didnt work😭
??
it didnt say anything
errors ?
if u can, can u try and come do it?, theres no errors or anything so idk whats happening
how
u can collab on roblox studio
o-
