Jump to content

SetTimer Issues


toptional

Recommended Posts

Havving issues with this setTimer thing

setTimer ( function doafk (commandname) 
outputChatBox("You will be AFK in 5 seconds",231,217,176, false ) 
  
end, 5000, 1 ) 
addCommandHandler("afk", doafk) 
  
setTimer ( function() 
        outputChatBox ( "5 second delay text!" ) 
    end, 5000, 1 ) 
  
  

Getting this error

WARNING: Loading script failed: AFK\client.lua:4: '(' expected near 'doafk'

Link to comment

Try this:

  
function doafk (commandName) 
setTimer ( function() 
outputChatBox("You will be AFK in 5 seconds",source,231,217,176, false ) 
end, 5000, 1 ) 
end 
addCommandHandler("afk", doafk) 
  
setTimer ( function() 
        outputChatBox ( "5 second delay text!" ) 
    end, 5000, 1 ) 
  
  

Link to comment

the SetElement Frozen doesn't work

function doafk (commandname) 
setTimer ( function() 
outputChatBox("You will be AFK in 5 seconds",255,0,0, false ) 
setElementAlpha(getLocalPlayer(),140)  
setElementFrozen ( player, true ) 
end, 5000, 1 ) 
end 
addCommandHandler("afk", doafk) 
  
  

WARNING AFK\client.lua:6: Bar argument @ 'setElementFrozen''

Getting this error

Link to comment

try this:

function doafk (commandname) 
     outputChatBox("You will be AFK in 5 seconds",231,217,176, false ) 
     setTimer(function() 
          outputChatBox("5 Seconds delay text!",255,0,0) 
          setElementAlpha(localPlayer,140) 
          setElementFrozen(localPlayer,true) 
     end,5000,1)  
end 
addCommandHandler("afk", doafk) 

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