I found this animation hotkey from the toolbox. Help, I want to make it when I press the key, activate the animation and when I press it again, it deactivate. Like a switch.
This is the script--
local player = game.Players.LocalPlayer local mouse = player:GetMouse()
function keyD(key) local key = key:lower() local hotkey = script.Hotkey.Value if key == hotkey then
local dance = Instance.new("Animation") dance.AnimationId = "rbxassetid://1506546104" local animloader = player.Character.Humanoid:LoadAnimation(dance) animloader:Play() end end
mouse.KeyDown:connect(keyD)

1 comment
Please format your code correctly. https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site