New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

How To Detect A New Player?

Asked by 3 months ago

I want to run a script making someones value (inside model of their character) a random number between 1 and 1000, but im having trouble detecting a player that's new. because i dont want them to have a different value every time they join. I thought of data store but then you must set the value of that so then it defeats the purpose of finding new players if you need that to make it work. Please Help!

1
datastore is you only option Fad99 278 — 3mo
1
Use the Event "PlayerAdded" 50ShadesofLamps 5 — 3mo

2 answers

Log in to vote
1
Answered by
sleazel 679 Moderation Voter
3 months ago
Edited 3 months ago

If you don't want to use datastores (which you should), you may use last three digits of player user id as a "random number":

local fakeRandomNumber = math.fmod(player.UserId,1000) +1
0
Yes this is good, it will be the same everytime so you dint have to save anything Fad99 278 — 3mo
0
thanks ill try... CommanderCaubunsia 108 — 2mo
0
i tried the data stores and it worked CommanderCaubunsia 108 — 1mo
Ad
Log in to vote
0
Answered by 1 month ago
Edited 1 month ago

i wrote basically

if datastore:getblahblahgarbage("new") == No then
(normal stuff)--means not new because datastores start off with NO value at all
else--it will activate if not "NO" which means player is new
datastore:setstuff:new,NO)
(do new stuff for new people an now data store for new for that person is "no" not "".

Answer this question