Hi there. I am very new to modding (only started yesterday) but i have some simple coding experience in python. I want to learn how to mod bully. I learned the basics of how to spawn peds and setting player health etc and I am trying to learn how to make a mission but i cant get the "PedIsInAreaXYZ" command to work properly. I have been changing and adapting my code for many hours but cannot get it to work.
Here is the code at the moment:
MissionSetup = function()
PlayerSetHealth(200)
AreaTransitionXYZ(0,270,-110,6.000000953674)
Gary = PedCreateXYZ(130,271,-73,5.992765495)
end
MissionCleanup = function()
end
function main()
repeat
Mission1()
wait(0)
until not Alive
end
Mission1 = function()
if PedIsInAreaXYZ(gPlayer,271,-73,5.992765495,10) then
TextPrintString("Success", 5, 1)
else main()
end
end
I tried to make the code constantly check if the player is in range of Gary by making the main function keep running the "Mission1" function.
I want the code to work like this:
1. Gary spawns at co-ordinates.
2. Player walks over to Gary.
3. Text "Success" is shown.
If anyone can give me some help i would really appreciate it

.
P.S. Sorry if the problem is extremely simple. I'm very new and couldn't find any help anywhere on the internet.