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

Pushing Rock

Shadowsong

Game Developer & Graphic Designer
Joined
Feb 23, 2010
Messages
3,446
Solutions
21
Reaction score
3,014
Location
Bosnia & Herzegovina
YouTube
ShivaShadowsong
Heya. I'm not an advanced scripter , I need just a tiny help on this script. It's not anything that hard for any experienced scripter , so it goes like:

If player uses the item [in this case, a stone], check if there are 3 players standing on the configured positions. If yes > teleport them all to X location , if not , give cancel message.

If anyone could do this for me , you have my 'thanks' and rep++.

Yours,
Shiva
 
edit an anni script you will need to change the config part delete one player from it. give the rock a unique id on ur map editor. try this

rockquest.lua
LUA:
local config = {
	level = 100,
	storage = 5026, 
	entry =
	{
		{x = 247, y = 659, z = 13},
		{x = 247, y = 660, z = 13},
		{x = 247, y = 662, z = 13}
	},
	destination =
	{
		{x = 189, y = 650, z = 13},
		{x = 189, y = 652, z = 13},
		{x = 189, y = 653, z = 13}
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

	local players = {}
	for _, position in ipairs(config.entry) do
		local pid = getTopCreature(position).uid
		if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			return true
		end

		table.insert(players, pid)
	end

	for i, pid in ipairs(players) do
		doSendMagicEffect(config.entry[i], CONST_ME_POFF)
		doTeleportThing(pid, config.destination[i], false)
		doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
	end

	doTransformItem(item.uid, item.itemid + 1)
	return true
end

<action uniqueid="XXXX" event="script" value="rockquest.lua"/>
 
Last edited:
Back
Top