Jump to content

Private shop random


Recommended Posts

  • Premium

C++ or LUA?

LUA: SetPolymorph(math.random(10000, 10100), true); OR SetPolymorph(number(10000, 10100), true);
C++: SetPolymorph(number(10000, 10100), true);
 
You can use the 2nd solution for both but there is a difference in LUA:
local var = number(1, 10);
local var2 = math.random(1, 10);
for i = 1, 10 do
     chat(var);
     chat(var2);
end -- for
 
will return a different output:
math.random will save the value in the variable, so "chat(var2)" will always return the same number.
while chat(var) will ALWAYS return a different number, cause the "number" function will always randomize the output, even if you save it in a variable, it doesn't save its value.
 
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

1 hour ago, NabbHackeR said:

C++ or LUA?

LUA: SetPolymorph(math.random(10000, 10100), true); OR SetPolymorph(number(10000, 10100), true);
C++: SetPolymorph(number(10000, 10100), true);
 
You can use the 2nd solution for both but there is a difference in LUA:
local var = number(1, 10);
local var2 = math.random(1, 10);
for i = 1, 10 do
     chat(var);
     chat(var2);
end -- for
 
will return a different output:
math.random will save the value in the variable, so "chat(var2)" will always return the same number.
while chat(var) will ALWAYS return a different number, cause the "number" function will always randomize the output, even if you save it in a variable, it doesn't save its value.
 

Nice functions.So this can be used in manny things...I want to make an quest so player with an special item can change his level random.With your function its easy.

Link to comment
Share on other sites

  • Premium
11 hours ago, Thanatos said:

Nice functions.So this can be used in manny things...I want to make an quest so player with an special item can change his level random.With your function its easy.

yes

http://pastebin.com/Bz1WMCVP

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium
7 minutes ago, Thanatos said:

Ohh,Thank you!

yw!

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.