YoungerTiny Posted August 25, 2014 Share Posted August 25, 2014 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
Olle Risk Posted August 25, 2014 Share Posted August 25, 2014 What does /debugscript 3 says? and are you sure you are running this server side and not as a client? Check that and I'm sure it will work out for you. /Olle Link to comment
YoungerTiny Posted August 25, 2014 Author Share Posted August 25, 2014 getRandomPlayer Sorry, I mean I'd like to give it to everyone if they play for 5 min, please. & if you could put the whole script that'd be great as I'm new . Link to comment
YoungerTiny Posted August 25, 2014 Author Share Posted August 25, 2014 What does /debugscript 3 says? and are you sure you are running this server side and not as a client? Check that and I'm sure it will work out for you./Olle Server side? i'm new to scripting & mta. If you could explain that'd be great. Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 Post your meta.xml PS: 1000 milliseconds = 1 second. So, 1000*60=60000 milliseconds =1 minute*5= 300000 milliseconds = 5 minutes Link to comment
YoungerTiny Posted August 25, 2014 Author Share Posted August 25, 2014 Post your meta.xmlPS: 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
Et-win Posted August 25, 2014 Share Posted August 25, 2014 <script src="server.lua" type="server" /> Link to comment
YoungerTiny Posted August 25, 2014 Author Share Posted August 25, 2014 <script src="server.lua" type="server" /> That's the script I'm trying to fix. Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 Put type="client" to type="server" ... Link to comment
YoungerTiny Posted August 25, 2014 Author Share Posted August 25, 2014 Put type="client" to type="server" ... Okay, I'll give it a go! Will this send money to everyone every 5 minute? Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 1000 milliseconds = 1 second. So, 1000*60=60000 milliseconds =1 minute*5= 300000 milliseconds = 5 minutes @setTimer Link to comment
YoungerTiny Posted August 25, 2014 Author Share Posted August 25, 2014 1000 milliseconds = 1 second. So, 1000*60=60000 milliseconds =1 minute*5= 300000 milliseconds = 5 minutes @setTimer Thank you so much! It's working. but just one last thing, so will this give everyone money if they play for 5 minute? Thanks Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 If you changed your setTimer time to what I said, then yes. Link to comment
YoungerTiny Posted August 25, 2014 Author Share Posted August 25, 2014 If you changed your setTimer time to what I said, then yes. Great stuff, thank's a lot. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now