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
the parent parameter of Instance.new() is decaperated, instead set the parent last
its still not working
Are you using R6 or R15? if you are using R6 you have to change the line 10