toptional Posted March 15, 2013 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'
TheIceman1 Posted March 15, 2013 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 ) Need paid scripter just pm me i will accept every job!
toptional Posted March 15, 2013 Author Posted March 15, 2013 Thanks it works but you forgot the n on function
TheIceman1 Posted March 15, 2013 Posted March 15, 2013 Edited You're welcome! Need paid scripter just pm me i will accept every job!
toptional Posted March 15, 2013 Author 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
TheIceman1 Posted March 15, 2013 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) Need paid scripter just pm me i will accept every job!
Jaysds1 Posted March 15, 2013 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) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
toptional Posted March 16, 2013 Author Posted March 16, 2013 Problem solved over skype, Thanks anyway.
Jaysds1 Posted March 16, 2013 Posted March 16, 2013 np My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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