Forum

> > CS2D > Scripts > Number randomly select
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Number randomly select

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Number randomly select

phalenkO
User Off Offline

Zitieren
Hi everyone

Its topic entered the my mind and can I ask the questions? I not tried the that questions.

Firstly or last, How to number randomly select? Its same spin and that spin select the randomly number. I wants defined number to ID.
1
math.random(1,32)
I founde the that but how to I using, idk.

alt Re: Number randomly select

Cure Pikachu
User Off Offline

Zitieren
@user Mami Tomoe: You forgot the all important # for
player(0,"table")
. What you are doing ATM is getting a random value between 1 and... a table (which will error out). Also, there can be gaps in the player IDs, so whatever this RNG pulls, may not even exist in the server

So if you want to RNG a random player ID that actually exists:
local ptab, pid
ptab = player(0,"table")
pid = ptab[math.random(#ptab)]
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht