Jump to content

My 1st script


A7mad-78

Recommended Posts

Posted

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

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

Posted
  
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

Posted

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) 

Posted

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) 

Posted

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!  
  

Posted

Yes I wanted to give random player $1250 Every 1 second Just this

And the script it's not working in my server

look i want when the ranndom player has $1250

it's write on server funcitons (randomPlayer, Has win 1025$ " )

Just like that

Posted

try this(server-side):

  
function hobo() 
local  player = getRandomPlayer ( ) 
givePlayerMoney(player, CASH HERE!) 
outputChatBox ( getPlayerName ( player ).." Won: CASH NUMBER HERE!" ) 
end 
setTimer(hobo, 1000, 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...