I’m wanting to make is so that every time my NPC goes to point B, there is a chance a random amount of cash ranging from 1-100 is added to the players leaderstat.
I will do this later, but I will also be making a shop system where if you buy something it will increase the chance of you receiving cash and/or receiving more cash. So I want to ensure my code is flexible.
I’m not sure how I can go about this as I’m not very good with things regarding leaderstats, so I would just like any form of assistance.
Here is my code:
local h = script.Parent
local a = workspace.WalkParts.a
local b = workspace.WalkParts.b
local c = workspace.WalkParts.c
while true do
h:MoveTo(a.Position)
wait(10)
h:MoveTo(b.Position)
--Assuming I add the code here
wait(5)
h:MoveTo(c.Position)
wait(10)
end
If something doesn’t make sense, please let me know, thank you!