alright so this script here works fine with detecting the players magnitude and creating the beam but for some reason it will not Destroy() the beam
LocalScript:
while wait() do
for i,v in pairs(game.Workspace.Beams:GetChildren()) do
local mag = (v.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
if mag <= 12 then
if v.Ready.Value == true then
if game.Players.LocalPlayer.Character:FindFirstChild("LookinBeam") == nil then
local beam = script.Beam:Clone()
beam.Name = "LookinBeam"
beam.Parent = game.Players.LocalPlayer.Character
beam.Attachment0 = v.Attachment
beam.Attachment1 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootRigAttachment
end
if mag >=13 and game.Players.LocalPlayer.Character:FindFirstChild("LookinBeam") then
game.Players.LocalPlayer.Character.LookinBeam:Destroy()
end
end
end
end
end

2 comments
lol wow big issue but a simple fix thanks man lol!
No problem :)