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

Step in X item - Teleport X place.

Winnerandy

Experienced Web Design'er
Joined
Oct 23, 2008
Messages
2,251
Reaction score
51
Location
Tellus.
Hello OTlanders!

FIRST SCRIPT: As the topic sais, you step in X item with x uid, you get teleported to x place (x, y, z)

SECOND SCRIPT: If you guys are able to do that, when you get teleported, you get x message, but when you use the tp again, you don't get the message..

Hope you guys can make these 2 scripts =)

Rep for the one who maskes it! :peace:
BTW, I use tfs 0.3.6pl

/Regards,
Winnerandy.
 
Last edited:
It's 1 script? ..
Winnerandy said:
If you guys are able to do that, when you get teleported, you get x message, but when you use the tp again, you don't get the message..
or this is the second one?
 
  1. Code:
    	<movevent type="StepIn" uniqueid="10000" event="script" value="scriptname1.lua"/>
    Code:
    local position = { x = 1000, y = 1000, z = 7 }
    
    function onStepIn(cid, item, position, fromPosition)
    	if(isPlayer(cid)) then
    		doTeleportThing(cid, position)
    		doSendMagicEffect(position, CONST_ME_TELEPORT)
    	end
    	return true
    end
  2. Code:
    	<movevent type="StepIn" uniqueid="10001" event="script" value="scriptname2.lua"/>
    Code:
    local config = {
    	position = { x = 1000, y = 1000, z = 7 },
    	message = "Text",
    	storage = 20000
    }
    
    function onStepIn(cid, item, position, fromPosition)
    	if(isPlayer(cid)) then
    		doTeleportThing(cid, config.position)
    		doSendMagicEffect(config.position, CONST_ME_TELEPORT)
    		if(getPlayerStorageValue(cid, config.storage) < 1) then
    			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, config.message)
    		end
    		setPlayerStorageValue(cid, config.storage, 1)
    	end
    	return true
    end
 
  1. Code:
    	<movevent type="StepIn" uniqueid="10000" event="script" value="scriptname1.lua"/>
    Code:
    local position = { x = 1000, y = 1000, z = 7 }
    
    function onStepIn(cid, item, position, fromPosition)
    	if(isPlayer(cid)) then
    		doTeleportThing(cid, position)
    		doSendMagicEffect(position, CONST_ME_TELEPORT)
    	end
    	return true
    end
  2. Code:
    	<movevent type="StepIn" uniqueid="10001" event="script" value="scriptname2.lua"/>
    Code:
    local config = {
    	position = { x = 1000, y = 1000, z = 7 },
    	message = "Text",
    	storage = 20000
    }
    
    function onStepIn(cid, item, position, fromPosition)
    	if(isPlayer(cid)) then
    		doTeleportThing(cid, config.position)
    		doSendMagicEffect(config.position, CONST_ME_TELEPORT)
    		if(getPlayerStorageValue(cid, config.storage) < 1) then
    			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, config.message)
    		end
    		setPlayerStorageValue(cid, config.storage, 1)
    	end
    	return true
    end

Second script is working fine, I got teleported and got message.
But the first script doesn't work, I only get effect and doesn't teleport to the given pos.
 
Back
Top