I'm trying to make a killer script that chases you but i just get this error saying
'attempt to index nil with 'GetPlayer' ' Someone help
heres is the beginning of the code
local RunService = game:GetService("RunService")
local Pkayers = game:GetService("Players")
local humanoid = script.Parent
local root = humanoid.Parent.PrimaryPart
local targetDistance = 20
local stopDistance = 5
function findNearestPlayer()
local playerList = Players:GetPlayer() -- the error is here
local nearestPlayer = nil
local distance = nil
local direction = nil
Please help

2 comments
Hi, when you were defining the variable "Players", you typed "Pkayers" instead of the word Players.
Also you did GetPlayer and it's supposed to be GetPlayers