#this code is causing a error for some reason
24 messages · Page 1 of 1 (latest)
@keen granite Hello could you please provide the context for this script so i can help
sure thing
one sec
local part = script.Parent.HumanoidRootPart
local maxDistance = 10
wait(5)
while true do
wait()
local nearestPlayer, nearestDistance
for _, player in pairs(Players:GetPlayers()) do
local character = player.Character
local distance = player:DistanceFromCharacter(part.Position)
if not character or
distance > maxDistance or
(nearestDistance and distance >= nearestDistance)
then
continue
end
nearestDistance = distance
nearestPlayer = player
PlayerHum = nearestPlayer:WaitForChild("HumanoidRootPart")
end
if nearestPlayer ~= nil then
print(PlayerHum:GetAttribute(Vector3))
CFrame.lookAt(PlayerHum:GetAttribute(Vector3))
wait()
end
end```
@rich knot here is the script
** You are now Level 3! **
also care to explain lol
ok dude
its not what it looks like
can you tell me what it is supposed to DO
that might help me find the problem
** You are now Level 1! **
@keen granite
@keen granite
oh sorry lol
thats satire lol