What kind of trigger to give money to player every 5mins

poom1995

New Member
Reaction score
0
i have a build game where every 5mins you get tax ie. 5000gold

what kind of trigger do i use:
-players get gold every 5 mins
-Show how long left on a timer till next tax

Thanks!
 

Magthridon96

Member
Reaction score
2
i think this is what he meant:
JASS:
library GiveTax
    private function give takes nothing returns nothing
        local player p = GetEnumPlayer()
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD) + 5000)
        set p = null
    endfunction
    
    private function expire takes nothing returns nothing
        call ForGroup(bj_FORCE_ALL_PLAYERS,function give)
    endfunction

    private module Init
        private static method onInit takes nothing returns nothing
            local timer t = CreateTimer()
            local timerdialog d = CreateTimerDialog(t)
            call TimerDialogSetTitle(d,"Tax")
            call TimerDialogDisplay(d,true)
            call TimerStart(t,300.0,true,function expire)
            set t = null
            set d = null
        endmethod
    endmodule
    private struct Inits extends array
        implement Init
    endstruct
endlibrary


I wrote this outside of JNGP, so there may be errors (I don't have access to JNGP at the moment)
 

dead-manakin

New Member
Reaction score
5
Why not try this:

EVENTS:
Time - every 360 seconds of time
CONDITIONS:

ACTIONS:
Give - All Players 5000 gold
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top