Jump to content

Random pay not working!


YoungerTiny

Recommended Posts

Hello, I got this script & I want to fix it as I need it for my server. I edited it a bit.

setTimer(function () 
local amount = math.random(5,35) 
for id, player in ipairs(getElementsByType("player")) do 
givePlayerMoney ( player, amount ) 
outputChatBox ( "[DayZ] You have received, $"..amount.." for playing on the server.", player, 255, 255, 255, true ) 
end 
end,60000,0) 
  

When in-game it shows the message and the ammount it choose but it does not actually pay me.

I'd like it to pay (player) an (amount) ranging from 5$ - 35$ randomly every 5 minute. please help me thanks alot!

Link to comment
Post your meta.xml

PS: 1000 milliseconds = 1 second. So, 1000*60=60000 milliseconds =1 minute*5= 300000 milliseconds = 5 minutes

This is what was in the meta.xml

<meta> 
    <info author="FlameSS" version="1.2" type="script" name="Random Money" description="Random Money" /> 
                 <script src="server.lua" type="client" /> 
                 <script src="Delete.lua" type="client" /> 
</meta> 

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