Jump to content

How to make functions to math.random?


Turbe$Z

Recommended Posts

Posted

I want make more than one function to math.random, when i click on a button, choose a function, for example god mode, or give weapons, how to make it? Sorry for my very bad english. :S

Posted

 

local random = math.random(1, 3) --change as appropriate
if random == 1 then
  --random action, e.g. give weapon
elseif random == 2 then
  --random aciton, e.g. give health
elseif random == 3 then
  --random action, e.g. give armor
--add more as appropriate
end

 

  • Like 1
Posted
19 hours ago, MrTasty said:

 


local random = math.random(1, 3) --change as appropriate
if random == 1 then
  --random action, e.g. give weapon
elseif random == 2 then
  --random aciton, e.g. give health
elseif random == 3 then
  --random action, e.g. give armor
--add more as appropriate
end

 

thanks

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...