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

Trying to Have it generate a SID But, the SID doesn't change? Please Help!

wait(0.1)
game.Players.PlayerAdded:connect(function(plr)
end)
local ID = game.ServerScriptService.Loader.ServerID.Value
local Length = math.random(3, 5)
for i = 1, Length do
	local N = math.random(1, 9)
	ID = ID..tostring(N)
end

This was my failure Attempt.

1 comment

0

Edited to add code block.

1 answer

✓ Accepted answer

Your randomseed is probably the same

Roblox has a reprehensibility to set the randomseed to be the same across server instances. What this means for you, is that your random number generation is the same every time a server starts.

math.randomseed(tick())

That one line normally solves most of those kinds of issues.

As for other issues:

  • Your SID is not truly unique, and can be shared by another server.
  • I don't see the point in this, as Roblox already provides you with a ServerId from the JobId and such.

3 comments

0

How do I get the ServerID @eLunate? I want a custom ID bc, its gonna send CMD's Latter on through Trello. Thanks for trying to help. If you could assist any more that would be great.

0

Okay, Thank you guys both!

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