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

[Request] onUse Teleportation

justin234

New Member
Joined
Jan 22, 2008
Messages
999
Reaction score
4
Hello.
Please read the following carefully,
so that you understand what I need.


I am placing the giant crystals around my map,
when a player uses them, I want them to be teleported to town.
I know this might be simple, but I cant script, atleast not well.

Kind Regards,
Justin.
 
For TFS

PHP:
--BY Waxel
function onUse(cid, item, frompos, item2, topos)
local text = "text here"
pos = getPlayerPosition(cid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
 doSendMagicEffect(pos,32)
 doSendAnimatedText(pos, text, 100)
 return TRUE
 end

and add
<action itemid="XXXX" script="crystal.lua"/>
xxxx= item of your choice
 
I need a position.

Not the temple, cause then pkers can use it and be tped into PZ.
Sorry for not being clear about it...
 
here

PHP:
--BY Waxel
function onUse(cid, item, frompos, item2, topos)
local text = "text here"
location = {x=1, y=1, z=1}-- coordinates
pos = getPlayerPosition(cid)

doTeleportThing(cid, location)
 doSendMagicEffect(pos,32)
 doSendAnimatedText(pos, text, 100)
 return TRUE
 end

Fixed something
 
Last edited:
Code:
[16/03/2009 01:41:23] attempt to index a nil value
[16/03/2009 01:41:23] stack traceback:
[16/03/2009 01:41:23] 	[C]: in function 'doSendMagicEffect'
[16/03/2009 01:41:23] 	data/actions/scripts/other/player_teleport.lua:5: in function <data/actions/scripts/other/player_teleport.lua:1>

It works, but I get that error...
 
--BY Waxel
function onUse(cid, item, frompos, item2, topos)
local text = "text here"
location = {x=1, y=1, z=1}-- coordinates
pos = getPlayerPosition(cid)

doTeleportThing(cid, location)
doSendMagicEffect(pos,32)
doSendAnimatedText(pos, text, 100)
return TRUE
end
 
Back
Top