Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make people get money NOT in leaderboard

How do I make people get money in 30 seconds which is not in the leaderboard. Thanks if you help me

3 answers

✓ Accepted answer

It's best to just store variables in the script instead of instancing a class and replicating it all over the place letting people hack it.

local money={}
game.Players.PlayerAdded:connect(function(player)
	money[player.Name]=0
end)

while wait(30)do
	for i,v in pairs(money)do
		money[i]=money[i]+100
	end
end

1 comment

0

Mistake! for i,v in pairs(money) needs to change to: for i,v in pairs(money) do

Same as leaderstats, though don't name the Holder "leaderstats".

If you want to store custom player attributes outside of the leaderboard, you could do it in several ways.

The simplest would be a lua table with the username or userID + an identifier (ex "Player1_money") and the value as the value...

If you need to access in multiple scripts, you could use the same approach as leaderstats, except don't name it leaderstats.

game (DataModel)
	Players (Player Service)
		Player1 (Player)
			CustomAttributes (BooleanValue)
				money (IntValue)

Or, if you want to persist it over game plays, you could use Data Persistence/ DataStore.

4 comments

0

I don't understand

0

What part don't you understand?

0

The script

0

It's not a script, It's showing what the explorer would look like.

This discussion is preserved as it was. New answers, comments, and votes are closed.