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

Addevent help

f@bio

Fudera Otserver
Joined
Jul 10, 2007
Messages
213
Reaction score
0
Location
Brasil
Hello friends, i'm want to use a FUNCTION ADDEVENT but i'm don't make this, i don't unterstand this...

Can someone help do explain for me how to use this???

>> A action to remove a stone after 30seconds...

>> A action to create WALL after 10 seconds...

>> A action to teleport player to position, for other position after 10 seconds...

Plx mans, help me do solve this question...

MAny thx..
 
according to my noob4X knowledge in addEvent (its the only function in lua I can handle perfectly -.-) in order to put an action and blabla is by creating function, addEvent executes this functions and put a timer on it... I don't know the parameters of addEvent so don't blame me if I put it wrong

by example

function RockyRemoving
local pos = {x=0000, y=0000, z=0}
doCreateItem(cid,blabla,pos)

end

function Switchingthingy

addEvent(cid,30000,rockyremoving)

end

or some like this :D
 
@Up!

You are so WRONG!!

use something like this..

Code:
-- THIS FUNCTION GOES IN THE SCRIPT WITH THE ALL OTHER FUNCTIONS --

local time = 10 -- in seconds

function removeStone()

local stonePos = {[COLOR="Red"][B]x[/B][/COLOR][COLOR="DarkGreen"][B]=[/B][/COLOR][COLOR="Blue"][B]345[/B][/COLOR], [COLOR="Red"][B]y[/B][/COLOR][B][COLOR="DarkGreen"]=[/COLOR][/B][COLOR="Blue"][B]1017[/B][/COLOR], [COLOR="Red"][B]z[/B][/COLOR][COLOR="DarkGreen"][B]=[/B][/COLOR][B][COLOR="Blue"]7[/COLOR][/B], [COLOR="Red"][B]stackpos[/B][/COLOR][COLOR="DarkGreen"][B]=[/B][/COLOR][B][COLOR="Blue"]STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE[/COLOR][/B]}
	if getThingfromPos(stonePos).itemid == [COLOR="Red"][B]STONE_ID_HERE[/B][/COLOR] then
	doRemoveItem(getThingfromPos(stonePos).uid,1)
	doSendMagicEffect(stonePos, CONST_ME_POFF)
	return TRUE
	end
end

	addEvent(removeTeleport, (1000*time))
 
Back
Top