Forum

> > CS2D > Scripts > RandomParse
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch RandomParse

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt RandomParse

Precel97
User Off Offline

Zitieren
Hi all! I was wondering about random script
Is this possible? I mean Randomscript then
parse something...
Can someone help?

alt Re: RandomParse

Banaan
User Off Offline

Zitieren
that prolly won't work TimeQuest...

1
2
3
4
5
6
local n = math.random(1, 5)
if n == 1 then
	-- parse
elseif n == 2 then
	-- parse something else
end

This will pick a random number between one and five. If that random number == 1, then it'll parse the first parse, if it == 2, it'll parse the second parse. That means about 20% change for each of the situations.

alt Re: RandomParse

RAVENOUS
BANNED Off Offline

Zitieren
however, random does use the same numbers after a while, use randomseed.

alt Re: RandomParse

KimKat
GAME BANNED Off Offline

Zitieren
As Tobey said use randomseed.

I also made a script that will trigger one of these walls, opening up just one path out of three. If any bugs, please correct it.
Spoiler >
Or use this code...
Spoiler >
I think it should work.

alt Re: RandomParse

Banaan
User Off Offline

Zitieren
Using a static math.randomseed is even worse than using none at all.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht