#press to play animation

41 messages · Page 1 of 1 (latest)

jovial bison
#

So im making a basketball game but when i scripted it so when it played the animation when you touched the screen it wont work, do yall have any scripts that can help?

quick cosmos
#

show the script

#

@jovial bison

jovial bison
quick cosmos
#

where is the script

jovial bison
#

Starter player scripts

#

@quick cosmos

copper yarrowBOT
#

studio** You are now Level 1! **studio

quick cosmos
#

wait a sec

#

are u good at scripting

#

or new

jovial bison
#

Kinda

quick cosmos
#
local UserInputService = game:GetService("UserInputService")
local Animation = script.Animation

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.Keycode == Enum.KeyCode.E then
    local Player = game.Players.LocalPlayer
    local Character = Player.Character
    local Humanoid = Character:WaitForChild("Humanoid")

    local Anim = Humanoid:LoadAnimation(Animation)
    Animation:Play(12920974366)
    end
end
#

try this

#

i am new so idk if it will work

jovial bison
#

ight thanks@

#

dont work

quick cosmos
#

da,m

nova beacon
#

Create a new animation wherever and pass that through the :LoadAnimation(Animation)

#

wait you already did that

#

it would be

Anim:Play()
jovial bison
#

it still not working @nova beacon

nova beacon
#

Send me what you wrote

#

the entire script rq

#

Just to see

jovial bison
#

local UserInputService = game:GetService("UserInputService")
local Animation = script.Animation

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.Keycode == Enum.KeyCode.E then
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")

    local Anim = Humanoid:LoadAnimation(Animation)
    Anim:Play(12920974366)
end

end

nova beacon
#
local UserInputService = game:GetService("UserInputService")
local Animation = script.Animation

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if input.Keycode == Enum.KeyCode.E then
        local Player = game.Players.LocalPlayer
        local Character = Player.Character
        local Humanoid = Character:WaitForChild("Humanoid")

        local Anim = Humanoid:LoadAnimation(Animation)
        Anim:Play()
    end
end
#

Try this

jovial bison
#

wait

#

where am i suppost to put the script?

#

@nova beacon

nova beacon
#

Well where did you have it before?

#

and what type of script is it?

jovial bison
jovial bison
nova beacon
#

Should work then

#

Test it out

jovial bison
#

lemme check if the actual animation works rq

copper yarrowBOT
#

studio** You are now Level 2! **studio