Jump to content

My 1st script


A7mad-78

Recommended Posts

Hi Every one i have problem in my script

it's very small script just for test

But it's has a problem

local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( RandomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000, 1, "xD!" ) 
  

And what i mean it's Get random player then give him a 1025$

And it's getrandomplayer every 1000second

Please help

Link to comment
  
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000000, 1000 ) -- 1000 = 1 second 
  

I could be wrong.

Link to comment
  
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000000, 1000 ) -- 1000 = 1 second 
  

I could be wrong.

it's steel not working

Link to comment

omg volk-rus! you did it wrong lol, try this.

local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000, 0 ) -- 1000 = 1 second 0 = how much times will the timer work (0 = infinite) 

Link to comment

i didn't even checked it, i just changed the timer arguments o_O.

btw thats because he never added a function :roll:

  
function random() 
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
end 
setTimer ( random, 1000, 0 ) -- 1000 = 1 second 0 = how much times will the timer work (0 = infinite) 

Link to comment

work checked on the server!

  
setTimer ( function ()  
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 )  
end, 1000, 0 )  -- Put some time you want!  
  

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

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