Anytime! I would recommend taking a very careful look at your code when you see erorrs like those so you know what it is! If you have anymore issues don’t be afraid to make another post!
local slashbeam = game.ServerStorage:WaitForChild(“slashbeam”)
local damage = 20
game.ReplicatedStorage.Slashbeam.OnServerEvent:Connect(function(player, CFrame)
local character = player.Character
local newskill = slashbeam:clone()
newskill.CanCollide = false
newskill.CFrame = character.HumanoidRootPart.CFrame
local bv = Instance.new(“BodyVelocity”)
bv.MaxForce = Vector3.new(6000,6000,6000)
bv.Velocity = (character.HumanoidRootpart.CFrame.lookvector*240)
bv.Parent = newskill
local playerpostion = (character.HumanoidRootPart.Position)
newskill.Parent = workspace
local skillhit
skillhit = newskill.Touched:connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
if hit.Parent.Name ~= player.Name then
hit.Parent.Humanoid:TakeDamage(damage)
end
end
end)
end)
while wait(0.5) do
local distance = (playerposition - newskill.Position).magnitude
if distance > 60 then
newskill:destroy()
end
end
wait(2)
if skillhit - nil then
skillhit:Disconnect()
end
newskill:Destroy()
Well I can see that newskill is only declared i nthe RemoteEvent, but you’re trying to get it outside of it, thus a problem occurs, referring to the last bit taht while loop