Jump to content

timer help


Desaster

Recommended Posts

I have made my first script and need some help :roll: my problem is to intergrate a timer into my script as I can set a timer than the player will be freezed than warped to my definied position but what my current script make is warp my player to postion than freese it than unfreese also i wanna make a limitb if one has >5000 only he can use /para it pls tell how it work and tell me my faults in my script :D

Client side :

function chadi ( commandName ) 
  
        setElementFrozen ( getLocalPlayer(), true ) 
        setElementPosition ( getLocalPlayer(), 1544.0194091797, -1352.6119384766, 329.47549438477 ) 
        setElementFrozen ( getLocalPlayer(), false ) 
        takePlayerMoney ( 5000 ) 
         
end 
         
         
        
  
addCommandHandler ( "para", chadi  ) 

Link to comment

Not sure, but I think this is what you want:

function chadi ( commandName ) 
        if ( isTimer ( TheTimer  ) ) then return end 
  
        setElementFrozen ( getLocalPlayer(), true ) 
        setElementPosition ( getLocalPlayer(), 1544.0194091797, -1352.6119384766, 329.47549438477 ) 
        TheTimer = setTimer ( function ( )  
            setElementFrozen ( getLocalPlayer(), false ) 
            takePlayerMoney ( 5000 ) 
        end, 5000, 1 ) 
end 
addCommandHandler ( "para", chadi  ) 

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