When the last click is reached and the NumberValue reaches <= 1 then it resets and gives a leaderstats value to the person who got the last click, but I want to be able to save the names of every player who contributed to at least 1 click of the 1000 and give all of them the stat but I’m not sure if there’s a function or how to store those names.
Make a table and store player names inside the table. When the last click happens, give the last player the reward instead of adding them to the table, and then loop through the table, do whatever you need, and clear the table. Read more here: Tables | Documentation - Roblox Creator Hub
--//Add this at the top of your script
local players = {}
--//Add this when a player clicks a button
table.insert(players, plr.Name)
--//Add this when the clicks left is 0
for _,p in pairs(players) do
--//reward code here
end
players = {}