• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved TFS 1.1 Globalevent onThink(interval) issue

Michael Orsino

Premium User
Staff member
Premium User
Support Team
Joined
Nov 15, 2007
Messages
864
Solutions
10
Reaction score
452
Location
Western Australia
Hi guys,

I'm trying to write a real simple global event but am getting an error message though the script is still running successfully.
As always, any help is greatly appreciated

<globalevent name="testglobal" interval="10000" script="testglobal.lua"/>
Code:
local function debugTwo()
    print("script is STILL running")
end

function onThink(interval)
    print("script is running")
    addEvent(debugTwo, 5000)
end

Console output:
Code:
script is running
[Error - GlobalEvents::think] Failed to execute event: testglobal
script is STILL running
 
Nevermind, I just needed to add a return true in the onThink function

Working example:
Code:
local function debugTwo()
    print("script is STILL running")
end

function onThink(interval)
    print("script is running")
    addEvent(debugTwo, 5000)
    return true
end
 
Back
Top