FSXTim Posted September 24, 2012 Share Posted September 24, 2012 Error (line 13): Bad argument @ 'setElementData' [expected element at argument one, got nil] function spam(message) local player = source local msg = getElementData(source, "Spam") if message == msg then outputChatBox("Bitte wiederhole dich nicht!", source, 255, 0, 0) cancelEvent() end if isTimer(spamTimer) then killTimer(spamTimer) end spamTimer = setTimer( function() setElementData(source, "Spam", "0") end , 10000, 1, source) setElementData(source, "Spam", message) end addEventHandler("onPlayerChat", getRootElement(), spam) Greets Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 function spam(message) local msg = getElementData(source, "Spam") if message == msg then outputChatBox("Bitte wiederhole dich nicht!", source, 255, 0, 0) cancelEvent() end if isTimer(spamTimer) then killTimer(spamTimer) end spamTimer = setTimer( function(source) setElementData(source, "Spam", "0") end , 10000, 1, source) setElementData(source, "Spam", message) end addEventHandler("onPlayerChat", getRootElement(), spam) Link to comment
Booo Posted September 24, 2012 Share Posted September 24, 2012 function spam(message) local msg = getElementData(source, "Spam") if message == msg then outputChatBox("Bitte wiederhole dich nicht!", source, 255, 0, 0) cancelEvent() end if isTimer(spamTimer) then killTimer(spamTimer) end spamTimer = setTimer( function(source) setElementData(source, "Spam", "0") end , 10000, 1, source) setElementData(source, "Spam", message) end addEventHandler("onPlayerChat", getRootElement(), spam) function spam(message) local msg = getElementData(source, "Spam") or setElementData(source, "Spam", "0") if message == msg then outputChatBox("Bitte wiederhole dich nicht!", source, 255, 0, 0) cancelEvent() end if isTimer(spamTimer) then killTimer(spamTimer) end spamTimer = setTimer( function(source) setElementData(source, "Spam", "0") end , 10000, 1, source) setElementData(source, "Spam", message) end addEventHandler("onPlayerChat", getRootElement(), spam) Link to comment
FSXTim Posted September 24, 2012 Author Share Posted September 24, 2012 Thank you, it's working now. Greets Link to comment
Booo Posted September 24, 2012 Share Posted September 24, 2012 Thank you, it's working now.Greets You're welcome 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