Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

how would I fix these errors in a NPC follow script?

Asked by 4 years ago
Edited 4 years ago

honestly Idk how many errors there are i got this online so please do a check for viruses as well thx! :)

01local NPC = script.Parent
02local Humanoid = script.Parent:FindFirstChild("Humanoid")
03local HRP = script.Parent:FindFirstChild("HumanoidRootPart")
04local function GetClosestPlayer(range)
05    local List = {}
06    local Target = nil
07    for i, v in pairs(game.Players:GetPlayers()) do
08        local dist = v:DistanceFromCharacter(HRP.position)
09        if dist <= range then
10            table.insert(List, {dist, v})
11        end
12    end
13 
14    table.sort(List, function(A, B)
15        return A[1] < B[1]
View all 56 lines...

Ps: I dont have the errors I kinda left the game alone and never went back to it lol its somewhere XD

0
"just fix them" isn't the best way to learn or get help. Exanut 81 — 4y
0
like Exanut said, don't just come here asking for people to fix your script. Also, if you even want any help on how to fix it atleast provide a picture, or maybe just type here what the errors are. NvidiaGeForce2080Ti -5 — 4y
0
sorry i know that was a bad idea LTRNightmare 66 — 4y
0
it would be better to ask for help by showing the code then the errors that your getting in output ErraticThe_legend27 8 — 4y

Answer this question