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

how do I make an animation click to play and click again to stop?

Asked by 8 years ago

My friend gave me this script to put inside StarterGui

local ConsiderForceField=true local Enabled=true local Player = game.Players.LocalPlayer

mouse = Player:GetMouse() function onKeyDown(key) Key = key:lower() if key == "z" then if Enabled==false then return end Enabled=false

Animations = script.Animz
AnimKey = Animations.Animation1

keyframesReached = 0
local animTrack = Player.Character.Humanoid:LoadAnimation(AnimKey)
animTrack.KeyframeReached:connect(function(keyframeName)
keyframesReached = keyframesReached + 1

end) animTrack:Play() wait(0.8) animTrack:Stop() Enabled=false end end mouse.KeyDown:connect(onKeyDown)

then inside that a model called animz and inside that an animation1.

So how can i make so that you can press the button to make it end?

0
Put the entire code inside a code block. TheHospitalDev 1134 — 8y

Answer this question