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

How would i make a one time bonus be given to a player?

I have a game, where BETA testers get a in game bonus which is +5 levels, and 2500 zeni. And i want it so when they join, they get the bonus only that one time, so they can't rejoin again and revive it over and over

I was thinking of making a script to where whenever the player is added to the game, it checks if a value in their data is true and if so it doesn't give them the bonus again

3 comments

0

Which is, what you should do!

0

hiimgoodpack appears with another very useful tip ^

0

Alright, i'll try it out

1 answer

✓ Accepted answer

Make a datastore that will store the bool for if the player has been given the bonus when the player joins, if the player is not in the datastore then give him the bonus and add him

BonusStorage = game:GetService("DataStoreService"):GetDataStore("Bonus")

game.Players.PlayerAdded:connect(function(plr)
	if not BonusStorage:GetAsync(plr.UserId) then	
		plr.Data.zeni.Value = plr.Data.zeni.Value + 2500
		plr.Data.Level.Value = plr.Data.Level.Value + 5
		BonusStorage:SetAsync(plr.UserId,true)
	end
end)

1 comment

0

Ohhh. I'm a little bit confuse though. Should i add a bool in my datastore?

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