Jump to content
×
×
  • Create New...
  • 0

Private shop random


Tallywa

Question

6 answers to this question

Recommended Posts

  • 0

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

👑 Premium International Lua Developer 👑

 My service topic: https://bit.ly/2UPly54

 

Ignorant people have the obligation to compensate their ignorance by paying whoever helps them.

Syreldar

Link to comment
  • 0
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
  • 0
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

👑 Premium International Lua Developer 👑

 My service topic: https://bit.ly/2UPly54

 

Ignorant people have the obligation to compensate their ignorance by paying whoever helps them.

Syreldar

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Read our Rules
  • Activity

    1. 0

      [Land of Heroes] We are looking for Game / Game Economy Designers

    2. 177

      Render Target Remastered

    3. 1

      MySQL stop when start server

    4. 0

    5. 59

      Emoji in TextLine

    6. 1

      MySQL stop when start server

  • Recently Browsing

    No registered users viewing this page.

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.