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

Can you help me on an Animation Tool when you press V?

Asked by 6 years ago
Edited 6 years ago
local player = game.Players.LocalPlayer
local hum = workspace:WaitForChild(player.Name):WaitForChild("Humanoid")

UIS = game:GetService('UserInputService')
bool = false

local animation = Instance.new("Animation")
animation.AnimationId = "http//roblox.com/asset/?id=1005558412"
local animTrack = hum:LoadAnimation(animation)



local function onkeypress(input, gpe)

    if input.KeyCode == Enum.KeyCode.V then
        if bool == false then


        animTrack:Play()--How long until animation plays.
        bool = false
        end

    elseif bool == false then

            animTrack:Stop()
            bool = true


    end
end

game:GetService("UserInputService").InputBegan:Connect(onkeypress)

https://gyazo.com/fc55377ca8d60c022ac3bd13c6974aa8

0
for when the animation stops, the event is UIS.InputEnded User#19524 175 — 6y
0
ok sorry i fixed code why is it not working now Ind1v1duals 43 — 6y

Answer this question