(error is on line 20)
code:
local Remote = game.ReplicatedStorage:WaitForChild("Magic")
Remote.OnServerEvent:Connect(function(Player,Action,MouseHit)
local Char = Player.Character
local Hum = Char:WaitForChild("Humanoid")
local HumRP = Char:WaitForChild("HumanoidRootPart")
local FX = script:WaitForChild("FX")
local Sounds = script:WaitForChild("Sounds")
local Anims = script:WaitForChild("Anims")
local TS = game:GetService("TweenService")
if Action == "Z" then
local Spear = FX.PlasmaSpear:Clone()
Spear.Parent = workspace
Spear.CFrame = HumRP.CFrame * CFrame.new(0,-5,0)
Spear.CFrame = CFrame.new(Spear.Position,MouseHit.p)
local Tween = TS:Create(Spear,TweenInfo.new(3),{CFrame = Spear.CFrame * CFrame.new(0,0.-130)})
Tween:Play()
game.Debris:AddItem(Spear,2.5)
delay(2.2, function()
local Tween = TS:Create(Spear,TweenInfo(0.3),{Transparency = 1})
Tween:Play()
end)
end
end)