#how do i make a tool script that plays the animation after u activate it

76 messages · Page 1 of 1 (latest)

zenith trellis
#

do you mean if a player clicks or equip the tool?

fading mica
#

like u hold the tool, then click screen

zenith trellis
#

ok

brazen abyss
#

give me a secccccccc

zenith trellis
#

give me a sec

fading mica
#

its a local

brazen abyss
zenith trellis
#

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)

fading mica
#

mk

zenith trellis
#

i think that should work

fading mica
#

should that be a normal script, local ect

brazen abyss
#

when uploading animation

#

and

zenith trellis
#

idk, i used a gun that i already made

brazen abyss
#

i don't understand this 2 strokes

#

tool.Activated won't work if tool is unequipped

fading mica
zenith trellis
#

yes, because the title says to play it if the tool is equipped

zenith trellis
brazen abyss
#

after u activate it

zenith trellis
brazen abyss
#

..

fading mica
#

?

brazen abyss
zenith trellis
#

@fading mica , do you want to play the anim if you even have the tool unequipped?

fading mica
#

yea

zenith trellis
#

ok

brazen abyss
#

xd

#

BRO

#

I DELETED A SCRIPT '='

fading mica
#

😭

zenith trellis
#

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

fading mica
zenith trellis
#

does it work?

fading mica
#

let me test rq

zenith trellis
#

ok

fading mica
#

i was sending it to make sure it was right

zenith trellis
#

ok ok

brazen abyss
#
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)
fading mica
zenith trellis
gloomy kilnBOT
#

studio** You are now Level 5! **studio

brazen abyss
#

i can make a mistake

fading mica
#

nope

brazen abyss
#

output errors

fading mica
#

didnt work😭

brazen abyss
#

??

fading mica
#

it didnt say anything

brazen abyss
#

u replaced that ?

fading mica
#

yep

brazen abyss
#

bruuh

#

copy again

#

i edited it

fading mica
#

didnt workagony

brazen abyss
#

errors ?

fading mica
#

nope

#

idk whats happening

fading mica
brazen abyss
#

how

fading mica
#

u can collab on roblox studio

brazen abyss
#

uhh

#

idk if i can cuz

fading mica
#

o-

brazen abyss
#

but k

#

ima just try