Jump to content

Turf bug


Error123

Recommended Posts

* the bug is when i enter a col shape the radar area start flashing then i wait and nothing heppen when i re-enter the turf it changes the color and gives me money. but i don't want it like that, i want it like when i enter the turf i wait 5seconds then the turf starts flashing then i wait 5 other second to get 5k and the turf stops flashing and changes the color.

addEventHandler( 
'onColShapeHit', root, 
    function( pla ) 
        if (getElementType( pla ) == "player") then 
            if (getPlayerTeam( pla )) then 
                setTimer ( function () setRadarAreaFlashing ( Area, true ) end, 5000, 1 ) 
                local r, g, b = getTeamColor ( getPlayerTeam( pla ) ) 
                if isRadarAreaFlashing (Area) then 
                    setTimer ( function() setRadarAreaFlashing ( Area, false ) givePlayerMoney (pla, 5000) setRadarAreaColor ( Area, r, g ,b, 125 ) end , 1000, 1 ) 
                end 
            end 
        end 
    end 
) 

  • Like 1
Link to comment

Try this:

addEventHandler ( 
    'onColShapeHit', root, 
    function ( pla ) 
        if ( getElementType ( pla ) == "player" ) then 
            if ( getPlayerTeam ( pla ) ) then 
                setTimer ( 
                    function ( ) 
                        setRadarAreaFlashing ( Area, true ) 
                        setTimer ( 
                            function ( ) 
                                local r, g, b = getTeamColor ( getPlayerTeam ( pla ) ) 
                                if isRadarAreaFlashing ( Area ) then 
                                    setRadarAreaFlashing ( Area, false ) 
                                    givePlayerMoney ( pla, 5000 ) 
                                    setRadarAreaColor ( Area, r, g, b, 125 ) 
                                end 
                            end 
                            ,5000, 1 
                        ) 
                    end 
                    ,5000, 1 
                ) 
            end 
        end 
    end 
) 

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