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

How To Put Animations Into A KeyPress Function?

Asked by 10 years ago

So I've trying to make it so when I key is pressed like F for example some code will run and an animation will play but because I don't know if ROBLOX allows you to put a function in a function I put the animation in a local script and the code in the other and it won't work. Heres the code.

    function onKeyDown(key) --Keydown function can't have Animation Function

    if key == "f" then
        a = game.Lighting.Script.Animation:Clone() --Trying to make Animation Run
    end
    end)

    mouse.KeyDown:connect(onKeyDown)
0
I might be doing this all wrong if so please correct me. SimpleFlame 255 — 10y
0
Figured it out :D! SimpleFlame 255 — 7y
0
Scratch that still broken :( SimpleFlame 255 — 2y

Answer this question