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

Need help with Action Script!!!

Rexanilator

New Member
Joined
Oct 3, 2009
Messages
297
Reaction score
2
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT),
	teleitem = 1448
}
	local spawn = {x=966, y=971, z=7}
	if item.itemid == config.teleitem then
			pos = {x=spawn.x, y=spawn.y, z=spawn.z}
			doTeleportThing(cid, pos)
			doSendMagicEffect(pos, 10)
		else
			doPlayerSendCancel(cid, "You cannot use this statue while in combat.")
		end
	end
	return true
end

I am trying to take out the part where they cannot use when they are in fight. I have tried all the ways I can think of can someone plz help me with this script. Rep+++ for the person who helps me with script!! It is the script of using an angel statue to get tped back to a place.
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT),
	teleitem = 1448
}
	local spawn = {x=966, y=971, z=7}
	if item.itemid == config.teleitem then
		if config.playerIsFighting == false then
			pos = {x=spawn.x, y=spawn.y, z=spawn.z}
			doTeleportThing(cid, pos)
			doSendMagicEffect(pos, 10)
		else
			doPlayerSendCancel(cid, "You cannot use this statue while in combat.")
		end
	end
	return true
end

Here is the script I tested it and I know it works I want the not able to use when in battle out because it causes players problems.
 
Back
Top