Radius script Error Need help

I made a thing where it checks if enemy players are near or not if yes then some stuff will glow
but im getting some errors
one of them being something about Character or something
heres my script

while wait() do
for _,v in pairs(game.Players:GetPlayers()) do
if v.Character ~= nil and v.Team ~= game.Players.LocalPlayer.Team and v.Character:FindFirstChild(“HumanoidRootPart”) ~= nil and (v.Character.HumanoidRootPart.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude <= range then
glow()
end
end
end

and sorry im new to the fourm idk how to use the bb code thing
Any help would be nice!

You can make a code snippet by putting 3 ` (not ') before and after the code section. You can also make a line formatted as code by putting 4 spaces before it.

You should also probably provide the error in full, as “[its] about character or something” doesn’t really help! :stuck_out_tongue: What does it say? Which line is on?

2 Likes

Just from the “about Character or something” it might be an issue where if the LocalPlayer doesn’t have a character, you’d get an issue there? So may be this part: game.Players.LocalPlayer.Character

But like @Mario118118 said, you should copy the error from the output because just guessing at what it is you’re probably not going to get accurate answers.

wait i am getting the error
from stdio

What’s the error you’re getting though? Can you copy & paste that here? It usually has line numbers and stuff in there that help to figure out what the problem is

idk what happened but the error is gone im getting this new error it says

bkhnihani2naia2:3: unexpected symbol near ’ ’

Did you copy the code in from here? It looks like it may be the quotes, specifically this part: “HumanoidRootPart”

You might have to switch that back to the regular quotes for it to work

it says error in script in studio but ingame it says the adnoawnladawbduawdbadauduwahdauddsbdauda thing

Maybe give it a screenshot then? Would give us the information we need to help

nvm i fixed it i just did some stupid stuff im sorry

1 Like