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

command !teleport (NPC)

Mbest

New Member
Joined
Dec 8, 2009
Messages
7
Reaction score
0
I need a script that when u type !teleport it would summon an npc to your current position. and dissapear once u have left that position so multiple players could not use him.

I know it's possible to do the npc on command but not sure how to make him disappear once you leave the position which you sumoned him at.

If you could help would be great Rep++
 
well I make it a little easier I need a command !teleportout

that will take you to (x 32345, y 32221, z 7) for a fee of 25k

I want it accessable for all players
 
Last edited:
teleportout.lua
Code:
local config = {
	pos = {x = 32345, y = 32221, z = 7},
	cost = 25000,
	allowBattle = false
}
function onSay(cid, words, param, channel)
	if((config.allowBattle or not config.allowBattle and getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and isPlayerPzLocked(cid) == FALSE) and doPlayerRemoveMoney(cid, config.cost) == TRUE) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
		doTeleportThing(cid, config.position)
		doSendMagicEffect(config.position, CONST_ME_TELEPORT)
	else
		doPlayerSendCancel(cid, getPlayerMoney(cid) < config.cost and "You don't have enough money, you need need " .. config.cost .." gold." or (not config.allowBattle and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE or isPlayerPzLocked(cid) == FALSE)) and "You may not use this command during a battle.")
	end

	return TRUE
end
talkactions.xml:
  • TFS 0.3
    Code:
    	<talkaction words="!uptime" event="script" value="teleportout.lua"/>
  • TFS 0.2
    Code:
    	<talkaction words="!uptime" script="teleportout.lua"/>
 
Back
Top