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

this script little bugged

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
PHP:
local function doTeleport(cid, count)
	if not isPlayer(cid) then
		return true
	end
	doSendAnimatedText(getCreaturePosition(cid), (10 - count).."s", COLOR_ORANGE)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_YELLOW_RINGS)
	if (count == 10) then
		return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
	else
		addEvent(doTeleport, 1000, cid, count + 1)
	end
	return true
end

function onCastSpell(cid, var)
	if isPlayerPzLocked(cid) then
		return not doPlayerSendCancel(cid, 'You cannot use this spell while PZLocked.')
	elseif not doPlayerRemoveMoney(cid, 20000) then
		return not doPlayerSendCancel(cid, 'You need 20k to use this spell.')
	else
		return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
	end
end

its a bring me ome spell that teleports player in 10 second to ohme temple , the spell is unable to use then player has PZ the red mark .

BUT the problem is that then plaeyr got pz from monster the normal x player can use the spell .

so if someone can fix the script i want that .player can use that spell only then they got totaly no pz
 
Test it now!

Code:
local function doTeleport(cid, count)
    if not isPlayer(cid) then
        return true
    end
    doSendAnimatedText(getCreaturePosition(cid), (10 - count).."s", COLOR_ORANGE)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_YELLOW_RINGS)
    if (count == 10) then
        return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
    else
        addEvent(doTeleport, 1000, cid, count + 1)
    end
    return true
end

function onCastSpell(cid, var)
    if isPlayerPzLocked(cid) and getCreatureCondition(cid, CONDITION_INFIGHT) then
        return not doPlayerSendCancel(cid, 'You cannot use this spell while PZLocked.')
    elseif not doPlayerRemoveMoney(cid, 20000) then
        return not doPlayerSendCancel(cid, 'You need 20k to use this spell.')
    else
        return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
    end
end
 
Back
Top