toptional Posted March 15, 2013 Share Posted March 15, 2013 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
TheIceman1 Posted March 15, 2013 Share Posted March 15, 2013 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
toptional Posted March 15, 2013 Author Share Posted March 15, 2013 Thanks it works but you forgot the n on function Link to comment
toptional Posted March 15, 2013 Author Share Posted March 15, 2013 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
TheIceman1 Posted March 15, 2013 Share Posted March 15, 2013 Try this: function doafk (commandname) setTimer ( function() outputChatBox("You will be AFK in 5 seconds",255,0,0, false ) setElementAlpha(getLocalPlayer(),140) setElementFrozen ( localPlayer, true ) end, 5000, 1 ) end addCommandHandler("afk", doafk) Link to comment
Jaysds1 Posted March 15, 2013 Share Posted March 15, 2013 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
toptional Posted March 16, 2013 Author Share Posted March 16, 2013 Problem solved over skype, Thanks anyway. 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