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

Lua Bug! Quest Door :o

ryan868

New Member
Joined
Dec 29, 2008
Messages
73
Reaction score
1
I have a script for a quest door "Only Premium Players Can Pass" and it works fine, but if a player stands inside the door and does mulitiple clicks on it fast the door will disapear..

is this a problem and fixable? (using tfs 0.3 beta 3)
heres my script

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPremiumDays(cid) >= 1 then
        if item.actionid == 5555 then
            doTransformItem(item.uid, item.itemid + 1)
            doTeleportThing(cid, toPosition, TRUE)
        end    
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only donators can access training rooms!")
    end
return TRUE
end
 
Yeah, solved:

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(isInArray(specialDoors, item.itemid) == TRUE) then
		if getPlayerFrags(cid) >= 10 then
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, TRUE)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only killers may pass")
		end

		return TRUE
	end
	return TRUE
end

it will only work with this id doors:

Code:
specialDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049, 8551, 8553, 9175, 9177, 9277, 9279}
 
Yeah, solved:

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(isInArray(specialDoors, item.itemid) == TRUE) then
		if getPlayerFrags(cid) >= 10 then
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, TRUE)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only killers may pass")
		end

		return TRUE
	end
	return TRUE
end

it will only work with this id doors:

Code:
specialDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049, 8551, 8553, 9175, 9177, 9277, 9279}

+reputation for you :D i was missing one line
 
Back
Top