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

Help in Script

tricolor1935

New Member
Joined
Nov 3, 2010
Messages
151
Reaction score
0
Location
Brazil
Hi guess I have my ot and this script is part of one quest!
The problem are, when you use switch do make quest its create a monster, and people are using that to get level. Click many time to create many monsters and gettling lvl up!

Can someone help me to edit it?

-- paradox by Delton --
local config =
{
newPos = {x=435, y=242, z=6}, -- nova posição
teleportPos = {x=437, y=241, z=7}, -- pos do TP
LeverPos = {x=438, y=245, z=7}, -- Lever pos
timeToRemove = 20 -- tempo to remove
}

function onUse(cid, item, frompos, item2, topos)
local teleport = getTileItemById(config.teleportPos, 1387)
local playerPos = getCreaturePosition(cid)
if item.itemid == 1718 then
doSendMagicEffect(config.teleportPos, CONST_ME_TELEPORT)
doSendMagicEffect(playerPos, CONST_ME_GIFT_WRAPS)
doCreatureSay(cid, "The monster has been created!", TALKTYPE_ORANGE_1)
doSummonCreature("Foreman Kneebiter", config.newPos)
addEvent(doRemoveTeleport, config.timeToRemove * 1000)
elseif item.itemid == 1718 then
doPlayerSendCancel(cid, "The monster has already been created.")
return 1
end
end

function doRemoveTeleport()
local teleport = getTileItemById(config.teleportPos, 1387)
local Lever = getTileItemById(config.LeverPos, 1718)
if teleport.uid > 0 then
doRemoveItem(teleport.uid)
doSendMagicEffect(config.teleportPos, CONST_ME_POFF)
doTransformItem(Lever.uid, 1718)
end
end
 
LUA:
local config = {
	newPos = {x=435, y=242, z=6}, -- nova posição
	teleportPos = {x=437, y=241, z=7}, -- pos do TP
	timeToRemove = 20, -- tempo to remove
	storage = 1500
}

local function doRemoveTeleport()
	local teleport = getTileItemById(config.teleportPos, 1387).uid
	if teleport > 0 then
		doRemoveItem(teleport)
		doSendMagicEffect(config.teleportPos, CONST_ME_POFF)
	end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, config.storage) == -1 and getTileItemById(config.teleportPos, 1387).uid == 0 then
		setPlayerStorageValue(cid, config.storage, 1)
		doSendMagicEffect(toPosition, CONST_ME_TELEPORT)
		doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
		doCreatureSay(cid, 'The monster has been created!', TALKTYPE_ORANGE_1)
		doSummonCreature('Foreman Kneebiter', config.newPos)
		addEvent(doRemoveTeleport, config.timeToRemove * 1000)
	else
		doPlayerSendCancel(cid, 'The monster has already been created.')
	end
	return true
end
 
Back
Top