• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Reward Movement

piraton

New Member
Joined
Jun 3, 2009
Messages
22
Reaction score
0
Hello, I would like a script that the players step on a tilde to send them a position and I gave them an item

thanks
 
..\data\movements\movements.xml
Code:
<movevent type="StepIn" actionid="50000" event="script" value="itemreward.lua"/>

..\data\movements\scripts\itemreward.lua
Code:
local config = { 
					storageid = 20000,
					position = {x = 1000, y = 1000, z = 7},
					itemid = 2148,
					itemcount = 2
				}
	
function onStepIn(cid, item, position, fromPosition)
	if(getPlayerStorageValue(cid, config.storageid) < 2) and (isPlayer(cid) == true) then
		if config.itemcount <= 1 then
			doPlayerSendTextMessage(cid, 22, "You recived " .. config.itemcount .. " " .. getItemNameById(config.itemid) .. ".")
		else
			doPlayerSendTextMessage(cid, 22, "You recived " .. config.itemcount .. " " .. getItemPluralNameById(config.itemid) .. ".")
		end
		doTeleportThing(cid, config.position, true)
		doPlayerSetStorageValue(cid, config.storageid, 2)
		doPlayerGiveItem(cid, config.itemid, config.itemcount)
	elseif (getPlayerStorageValue(cid, config.storageid) >= 2) then
		doPlayerSendTextMessage(cid, 22, "You allready recived the reward.")
	elseif (isPlayer(cid) == false) then
	-- Do Nothing
	end
		return true
	end

And edit this on the title on your map:
0oekF0.png

Greetings,
Manack :)
 
Last edited:
..\data\movements\movements.xml
Code:
<movevent type="StepIn" actionid="50000" event="script" value="itemreward.lua"/>

..\data\movements\scripts\itemreward.lua
Code:
local config = { 
					storageid = 20005,
					position = {x = 1000, y = 1000, z = 7},
					itemid = 2148,
					itemcount = 2
				}
	
function onStepIn(cid, item, position, fromPosition)
	if(getPlayerStorageValue(cid, config.storageid) < 2) then
		if config.itemcount <= 1 then
			doPlayerSendTextMessage(cid, 22, "You recived " .. config.itemcount .. " " .. getItemNameById(config.itemid) .. ".")
		else
			doPlayerSendTextMessage(cid, 22, "You recived " .. config.itemcount .. " " .. getItemPluralNameById(config.itemid) .. ".")
		end
		doTeleportThing(cid, config.position, true)
		doPlayerSetStorageValue(cid, config.storageid, 2)
		doPlayerGiveItem(cid, config.itemid, config.itemcount)
	else
		doPlayerSendTextMessage(cid, 22, "You allready recived the reward.")
	end
		return true
	end

And edit this on the title on your map:
View attachment 17859

Greetings,
Manack :)
but why all that script :D :P , just he want to telport to another positon :P
 
You may write this under the function:
LUA:
if isPlayer(cid) then

To prevent errors, when monster steps in.
 

Similar threads

Back
Top