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

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

Asked by 9 years ago
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.

0
Edited to add code block. BlueTaslem 18071 — 9y

1 answer

Log in to vote
2
Answered by 9 years ago

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.

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. EvolutionaryCode 15 — 9y
0
Okay, Thank you guys both! EvolutionaryCode 15 — 9y
Ad

Answer this question