Jump to content

time random


eduher

Recommended Posts

Posted

Hello who can help me I want to make a script to select a random player and money for 5 minutes increase from 50 cents to 50 cents functions I use a script or community that seems :roll:

Posted
  
local money = 0 -- variable that's used for storing the money, you must have this in order to raise the money by 50 every time 
  
setTimer(function() 
        local randomPlayer = getRandomPlayer() -- function for getting a random player 
        money = money + 50 -- increases the money every time executed by 50 
        givePlayerMoney(randomPlayer, money) -- function to give the random player money 
end, 5000, 0) -- if you dont know what these numbers are, go search "setTimer syntax MTA" 
  

It's not hard to make, try doing it yourself next time.

Posted

Wrong luka, with a timer 5000 = 5 seconds. 5 minutes = 300000.

money = 0 
setTimer(function() 
        money = money + 50 
        givePlayerMoney(getRandomPlayer(), money)  
end, 300000, 0) 

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...