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

Why won't my character play the animation when the button is pressed?

Asked by 5 years ago

When the X button is held down, you're supposed to be able to charge, it was working last night, but when I started it up today, it didn't want to work. Can anyone help? The script is a regular script in ServerScriptService.

game.Players.PlayerAdded:Connect(function(p)
    wait(5)
    local uis = game:GetService("UserInputService")
    local animation = Instance.new("Animation", workspace)
    animation.AnimationId = "rbxassetid://2405207143"
    local rstorage = game:GetService("ReplicatedStorage")
    local particles = rstorage:WaitForChild("ChargeParticles")
    local normalcharge = particles:WaitForChild("NormalCharge"):GetChildren()
    local char = p.Character
    local torso = p.Character:WaitForChild("UpperTorso")
    local chargeanimation = char.Humanoid:LoadAnimation(animation)
    uis.InputBegan:Connect(function(input,gameprocesed)
        if input.KeyCode == Enum.KeyCode.X then
            chargeanimation:Play()
            wait(.6)
            for _,v in pairs(normalcharge) do
                if v.Name == "Aura1" or v.Name == "Aura2" or v.Name == "Aura3" then
                    v:Clone().Parent = torso
                end
            end

        end
    end)

    uis.InputEnded:Connect(function(input,gameprocesed)
        if input.KeyCode == Enum.KeyCode.X then
            chargeanimation:Stop()
            local removeparticles = torso:GetChildren()
            for _, v in pairs(removeparticles) do
                if v.Name == "Aura1" or v.Name == "Aura2" or v.Name == "Aura3" then
                    v:Destroy()
                end
            end
        end
    end)
end)
0
the parent parameter of Instance.new() is decaperated, instead set the parent last User#23365 30 — 5y
0
its still not working supercoolboy8804 114 — 5y
0
Are you using R6 or R15? if you are using R6 you have to change the line 10 C1RAXY 81 — 5y

2 answers

Log in to vote
0
Answered by
C1RAXY 81
5 years ago

Maybe you are using R6 instead of R15.

if you are using R6 edit the line 10.

0
i am using r15 >-> supercoolboy8804 114 — 5y
Ad
Log in to vote
0
Answered by
wentman 19
5 years ago

I am also receiving problems like you, last night, Roblox updated the Studio and probably created a bug.

Answer this question