Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How To Detect A New Player?

Asked by 4 years 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 286 — 4y
1
Use the Event "PlayerAdded" 50ShadesofLamps 5 — 4y

2 answers

Log in to vote
1
Answered by
sleazel 1287 Moderation Voter
4 years ago
Edited 4 years 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 286 — 4y
0
thanks ill try... CommanderCaubunsia 126 — 4y
0
i tried the data stores and it worked CommanderCaubunsia 126 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years 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