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

Windows [Request] Teleport on use item

Alastore

New Member
Joined
Oct 12, 2011
Messages
7
Reaction score
0
Hi, I'm a kinda new scripter and I couldn't find what I think is a simple script...

A function on use item that teleports a player somewhere else (in a quest or something).

My item is : ID:1983

Could someone help me out ?
 
Code:
function onUse(cid, item, frompos, item2, topos)
playerpos = getPlayerPosition(cid) 
newpos = {x=XXX, y=YYY, z=Z} 

if item.uid == XXXX Then
getThingfromPos(playerpos)
doTeleportPlayer(cid, newpos)
end
end


Btw use the "request" board next time :)
 
Ty very much :D

Would it be possible to make it impossible to be teleported when you got pz locked ? :S

(next time yeah i'll use request board, thought it was the same than here coz I needed help xD)
 
Code:
function onUse(cid, item, frompos, item2, topos)

playerpos = getPlayerPosition(cid) 
newpos = {x=XXX, y=YYY, z=Z} 

if item.uid == XXXX then 
if hasCondition(cid, CONDITION_INFIGHT) ~= 1 then
	getThingfromPos(playerpos)
	doTeleportPlayer(cid, newpos)
else
doPlayerSendTextMessage(cid,"You must lose pz")
end
end
return true
end
 
Back
Top