• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Can someone help me please.

kermit

™Kermit™
Joined
Oct 6, 2008
Messages
73
Reaction score
12
I have a problem look:

[23/12/2008 12:34:39] Lua Script Error: [MoveEvents Interface]
[23/12/2008 12:34:39] data/movements/scripts/entrancepoii.lua:eek:nStepIn

[23/12/2008 12:34:39] attempt to index a number value
[23/12/2008 12:34:39] stack traceback:
[23/12/2008 12:34:39] [C]: in function 'getThingfromPos'
[23/12/2008 12:34:39] data/movements/scripts/entrancepoii.lua:9: in function <data/movements/scripts/entrancepoii.lua:2>


Here is the script:
--function by Armageddom--
function onStepIn(cid, item, frompos, item2, topos)

playerpos = getPlayerPosition(cid)
novapos = {x=348, y=441, z=8}

if item.uid == 3232 then

getThingfromPos(playerpos)
doSendMagicEffect(playerpos,2)
doTeleportThing(cid,novapos)
doSendMagicEffect(novapos,10)
end
end


I'm using the latest tfs 0.2 i need it to send a player to a certain location after click use on the grave. POI DUH! :D thx hopefully someone will help me !
 
actually its not onUse, but onStepIn action. So if you want to execute action after player use item, then you need to change header of this function to:
function onUse(cid, item, fromPosition, itemEx, toPosition)

Thats your @evul Pro script :D

Code:
local newPos = {x = 666, y = 555, z = 444}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	doTeleportThing(cid, newPos)
	doSendMagicEffect(newPos, CONST_ME_TELEPORT)
	return TRUE
end
 
Function "getThingfromPos" is unuseful in that script.

Code:
function onStepIn(cid, item, pos, fromPosition)

playerPos = getPlayerPosition(cid) 
newPos = {x=348, y=441, z=8}

if item.uid == 3232 then
	
	doSendMagicEffect(playerPos,2)
	doTeleportThing(cid,newPos)
	doSendMagicEffect(newPos,10)

	end
end
 
Back
Top