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

How To Detect A New Player?

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!

2 comments

1

datastore is you only option

1

Use the Event "PlayerAdded"

2 answers

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

3 comments

0

Yes this is good, it will be the same everytime so you dint have to save anything

0

thanks ill try...

0

i tried the data stores and it worked

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 "".

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