when you press F this is supposed to fire. Of course, that's in a local script, Which works and is irrelevant to this.

local remotes = game:GetService('ReplicatedStorage'):WaitForChild('Remotes')
local items = game:GetService('ReplicatedStorage'):WaitForChild('Items')
local ps = game:GetService('PhysicsService')


remotes.FireBlast.OnServerInvoke = function(gamer)
	local body = gamer.Character
	if body then 
		local huma = body.Humanoid
		local arm = body:FindFirstChild('Right Arm')
	if huma and huma:FindFirstChild('Animator') and arm then
		local animation = Instance.new('Animation')
		animation.AnimationId = 'rbxassetid://2585156325'
		animation = huma:LoadAnimation(animation)

		animation:Play()
		animation.KeyframeReached:Wait(0.2)
		
		local orb = items:FindFirstChild('FireBlast'):Clone()
		orb.CFrame = arm.CFrame * CFrame.new(0,-2.4,0)
		orb.Parent = workspace
		
		
		local vel = Instance.new('BodyVelocity', orb)
		vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		vel.Velocity = arm.CFrame.UpVector * -100
		
		game.Debris:AddItem(orb, 1.2)
		
		orb:SetNetworkOwner(nil)
	end
	end
end

^^this is in ServerScriptService and in a normal script

for some reason the animation only plays once. Please Help!

4 comments

0

The local script is relevant since it's handling the Remote firing and input. Why not use a RemoteEvent for this too?

0

In this case it would be better to use a local script to play the animation then only ask the server to create the part. Local parts would also be useful.

0

Do you have the script for pressing the key?

0

i do.