• 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!

[Resolved]GlobalEvent Callback problem.

Lanibox

Brutal1ty.com
Joined
Sep 21, 2010
Messages
179
Reaction score
4
Hey, im trying to make stone which removes every 60 seconds for 5 seconds.

Im getting this
Code:
<luaAddEvent> Callback parameter should be a function.

Code:
local stoneId = 1304
local stonePos = {x = 1004, y = 990, z = 7, stackpos = 1}
local textPos = {x = 1004, y = 990, z = 7}
local seconds = 60
local seconds2 = 5

function contDown()
	doSendAnimatedText(textpos, seconds, TEXTCOLOR_RED)
	if seconds == 0 then
		doRemoveItem(getThingfromPos(stonePos), 1)
		addEvent(countUp, 1000)
	else
		seconds = seconds - 1
		addEvent(countDown, 1000)
	end
end

function countUp()
	doSendAnimatedText(textpos, seconds2, TEXTCOLOR_GREEN)
	if seconds2 == 0 then
		doCreateItem(stoneID, 1, stonePos)
	else
		seconds2 = seconds2 - 1
		addEvent(countUp, 1000)
	end
end

function onStartup()
	addEvent(countDown, 1000)
end

Been long time since last time scripted anything :p
 
Last edited:
Hey, im trying to make stone which removes every 60 seconds for 5 seconds.

Im getting this
Code:
<luaAddEvent> Callback parameter should be a function.

Code:
local stoneId = 1304
local stonePos = {x = 1004, y = 990, z = 7, stackpos = 1}
local textPos = {x = 1004, y = 990, z = 7}
local seconds = 60
local seconds2 = 5

function contDown()
	doSendAnimatedText(textpos, seconds, TEXTCOLOR_RED)
	if seconds == 0 then
		doRemoveItem(getThingfromPos(stonePos), 1)
		addEvent(countUp, 1000)
	else
		seconds = seconds - 1
		addEvent(countDown, 1000)
	end
end

function countUp()
	doSendAnimatedText(textpos, seconds2, TEXTCOLOR_GREEN)
	if seconds2 == 0 then
		doCreateItem(stoneID, 1, stonePos)
	else
		seconds2 = seconds2 - 1
		addEvent(countUp, 1000)
	end
end

function onStartup()
	addEvent(countDown, 1000)
end

Been long time since last time scripted anything :p

Looks like a simple grammar mistake
you wrote:
Code:
function contDown()
should be
Code:
function countDown()
 
just grammar mistakes:
Lua:
local stoneId = 1304
local stonePos = {x = 1004, y = 990, z = 7, stackpos = 1}
local textPos = {x = 1004, y = 990, z = 7}
local seconds = 60
local seconds2 = 5

function contDown()
	doSendAnimatedText(textPos, seconds, TEXTCOLOR_RED)
	if seconds == 0 then
		doRemoveItem(getThingfromPos(stonePos), 1)
		addEvent(countUp, 1000)
	else
		seconds = seconds - 1
		addEvent(countDown, 1000)
	end
end

function countUp()
	doSendAnimatedText(textPos, seconds2, TEXTCOLOR_GREEN)
	if seconds2 == 0 then
		doCreateItem(stoneId, 1, stonePos)
	else
		seconds2 = seconds2 - 1
		addEvent(countUp, 1000)
	end
end

function onStartup()
	addEvent(countDown, 1000)
end
 
just grammar mistakes:
Lua:
local stoneId = 1304
local stonePos = {x = 1004, y = 990, z = 7, stackpos = 1}
local textPos = {x = 1004, y = 990, z = 7}
local seconds = 60
local seconds2 = 5

function contDown()
	doSendAnimatedText(textPos, seconds, TEXTCOLOR_RED)
	if seconds == 0 then
		doRemoveItem(getThingfromPos(stonePos), 1)
		addEvent(countUp, 1000)
	else
		seconds = seconds - 1
		addEvent(countDown, 1000)
	end
end

function countUp()
	doSendAnimatedText(textPos, seconds2, TEXTCOLOR_GREEN)
	if seconds2 == 0 then
		doCreateItem(stoneId, 1, stonePos)
	else
		seconds2 = seconds2 - 1
		addEvent(countUp, 1000)
	end
end

function onStartup()
	addEvent(countDown, 1000)
end

Thanks! Forgot how strict its with Lua :)
 
Back
Top