I know there has been posts on this error but I don’t understand whats wrong can someone help?
The error is on line 16
Code:
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Beam = script:WaitForChild("Beam"):Clone()
local function CreateBeam(Beam, Attachment0, Part)
local Attachment1 = Part:FindFirstChild("Attachment")
if Attachment1 then
Beam.Attachment0 = Attachment0
Beam.Attachment1 = Attachment1
end
end
game.ReplicatedStorage.ArrowEvent.OnClientEvent(function(Part, Value)
if Value == true then
local Attachment0 = HumanoidRootPart:FindFirstChild("RootRigAttachment")
CreateBeam(Beam, Attachment0, Part)
Beam.Parent = Character
else
Beam:Remove()
end
end)