• 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 this trap script rep+

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
doCreatureSetNoMove(cid, true)
doSendMagicEffect(getCreaturePosition(cid), 31)
doCreatureSay(cid, "STUNNED!", TALKTYPE_RED_1)
addEvent(doCreatureSetNoMove, 1000*4, cid, false)
doRemoveItem(item.uid)
return true
end

well i want to add exhaustion for 4 segs too
then i should add: addEvent(doCreatureExhausted, 1000*4, cid, false) ????

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
doCreatureSetNoMove(cid, true)
doSendMagicEffect(getCreaturePosition(cid), 31)
doCreatureSay(cid, "STUNNED!", TALKTYPE_RED_1)
addEvent(doCreatureSetNoMove, 1000*4, cid, false)
addEvent(doCreatureSetNoMove, 1000*4, cid, false)
doRemoveItem(item.uid)
return true
end
like this?


ugh i dont know so much about scripting.. can somebody help me?? :S
 
Please use
LUA:
 [/lua.] tags without the . ofcourse.

And could u please explain what should the script do?
 
oh sorry well
its a trap an x item you throw on the floor and if you step in you will be unmoveable for 4 segs
also i want to add 4 segs of exhaustion if you step in the trap
 
maybe it is a trap but still.... use the [.lua] [./lua] tags... it doesnt matter that its a trap... it still looks better with the tags :)
 
trap exhaust or player spell exhaust?
LUA:
local t, e = {}, {}

for i = EXHAUST_COMBAT, EXHAUST_HEALING do
	t[i] = createConditionObject(CONDITION_EXHAUST)
	setConditionParam(t[i], CONDITION_PARAM_SUBID, i)
	setConditionParam(t[i], CONDITION_PARAM_TICKS, 4000)
end

t[3] = createConditionObject(CONDITION_PACIFIED)
setConditionParam(t[3], CONDITION_PARAM_TICKS, 4000)

local function f(cid)
	if isPlayer(cid) then
		doCreatureSetNoMove(cid, false)
	end
	e[cid] = nil
end

function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
		doRemoveItem(item.uid)

		doCreatureSetNoMove(cid, true)
		for _, v in ipairs(t) do
			doAddCondition(cid, v)
		end

		doSendMagicEffect(pos, CONST_ME_STUN)
		doCreatureSay(cid, 'STUNNED!', TALKTYPE_ORANGE_1)
		if e[cid] then
			stopEvent(e[cid])
		end
		e[cid] = addEvent(f, 4000, cid)
	end
end
 
Last edited:
works perfect ty :)


only one thing man...
is it possible that when exhausted, the victim cant use potions?

is it possible?
 
Last edited:
Back
Top