Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

3 comments

0

the parent parameter of Instance.new() is decaperated, instead set the parent last

0

its still not working

0

Are you using R6 or R15? if you are using R6 you have to change the line 10

2 answers

Maybe you are using R6 instead of R15.

if you are using R6 edit the line 10.

1 comment

0

i am using r15 >->

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

This discussion is preserved as it was. New answers, comments, and votes are closed.