• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action (Advanced) Cigarette

Tenaria

New Member
Joined
Apr 26, 2009
Messages
142
Reaction score
2
Hello Guys.. :p As the Thread shows, its the Cigarette
Much of us smoking also why not ingame with an advanced Script !
Take it :p

Code:
function onUse(cid, item, frompos, item2, topos)

	doSendMagicEffect(frompos,2)
	queststatus = getPlayerStorageValue(cid,99980)
	hp = getPlayerHealth(cid)
	chance = math.random(2,3)
	effect = math.random(29,31)

if queststatus == -1 then
	if hp > 30 then
 	doPlayerSay(cid,"Aaaahh, weeed!",17)
	doSendMagicEffect(frompos,36)
 	doPlayerAddHealth(cid,-30)
      setPlayerStorageValue(cid,99980,1)
	return 1
	else
	doPlayerSendCancel(cid,"It is too hard for you.") 
	end
end

if queststatus == 1 then
	if hp > 100 then
 	doPlayerSay(cid,"Aaaaaaaaahhh...Hard Shit!",17)
	doSendMagicEffect(frompos,36)
 	doPlayerAddHealth(cid,-100)
      setPlayerStorageValue(cid,99980,chance)
	return 1
	else
	doPlayerSendCancel(cid,"It is too hard for you.") 
	end
end

if queststatus == 2 then
	if hp > 300 then
      setPlayerStorageValue(cid,99980,3)
 	doPlayerSay(cid,"~Aaaaaaaaaaaaaaaaaaaaaaahh OMG!~",17)
	doSendMagicEffect(frompos,36)
 	doPlayerAddHealth(cid,-300)
	return 1
	else
	doPlayerSendCancel(cid,"It is too hard for you.") 
	end
end

if queststatus == 3 then
	setPlayerStorageValue(cid,99980,-1)
	doPlayerSendTextMessage(cid,21,"Please don't smoke that much.")
 	doPlayerSay(cid,"OK! I stop now.",16)
	doSendMagicEffect(frompos,effect)
return 1
end
end

:thumbup::p
 
Fixed ... <_<
Code:
local t = {
	[-1] = {"Aaaahh, weeed!", 30, 1, },
	[1] = {"Aaaaaaaaahhh...Hard Shit!", 100, "rand"},
	[2] = {"~Aaaaaaaaaaaaaaaaaaaaaaahh OMG!~", 300, 3},
	[3] = {"OK! I stop now.", 0, -1, "Please don't smoke that much."}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = t[getPlayerStorageValue(cid, 99980)]
	doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	if getCreatureHealth(cid) > i[2] then
		doCreatureSay(cid, i[1], TALKTYPE_ORANGE_1)
		doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 99980) == #t and math.random(CONST_ME_FIREWORK_RED, CONST_ME_STUN) or CONST_ME_FIREATTACK)
		doCreatureAddHealth(cid, -i[2])
		setPlayerStorageValue(cid, 99980, i[3] == "rand" and math.random(#t-1, #t) or i[3])
	else
		doPlayerSendCancel(cid,"It is too hard for you.")
	end
	return true
end
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local queststatus = getPlayerStorageValue(cid,99980)
local hp = getCreatureHealth(cid)
local chance = math.random(2,3)
local effect = math.random(29,31)
doSendMagicEffect(fromPosition,2)
	if queststatus < 1 then
		if hp > 30 then
			doCreatureSay(cid,"Aaaahh, weeed!",19)
			doSendMagicEffect(fromPosition,36)
			doCreatureAddHealth(cid,-30)
			setPlayerStorageValue(cid,99980,1)
			return TRUE
		else
			doPlayerSendCancel(cid,"It is too hard for you.")
		end
	elseif queststatus == 1 then
		if hp > 100 then
			doCreatureSay(cid,"Aaaaaaaaahhh...Hard Shit!",19)
			doSendMagicEffect(fromPosition,36)
			doCreatureAddHealth(cid,-100)
			setPlayerStorageValue(cid,99980,chance)
			return TRUE
		else
			doPlayerSendCancel(cid,"It is too hard for you.")
		end
	elseif queststatus == 2 then
		if hp > 300 then
			setPlayerStorageValue(cid,99980,3)
			doCreatureSay(cid,"Aaaaaaaaaaaahh OMG!~",19)
			doSendMagicEffect(fromPosition,36)
			doCreatureAddHealth(cid,-300)
			return TRUE
		else
			doPlayerSendCancel(cid,"It is too hard for you.")
		end
	elseif queststatus == 3 then
		setPlayerStorageValue(cid,99980,-1)
		doPlayerSendTextMessage(cid,22,"Please don't smoke that much.")
		doCreatureSay(cid,"OK! I stop now.",19)
		doSendMagicEffect(fromPosition,effect)
	end
return TRUE
end
Fixed, shortened a bit (use elseif instead of closing ifs omg). Also, now return is using boolean values (am I right?) so now it's TRUE or FALSE only, not 1/0.
 
Ty anyways, the script was old from "8.10" and worked fine :p
 
haha, [sarcasm]advanced code right there[/sarcasm] :D nah but really cheers for releasing.

EDIT: Should make it when your holding the cigarette in your hand it does executes the code :p rather than onUse
 
Yea that fixxed one from Cyko or the other one should be work >.> mine too i think o.o
 
I do beleive this is a Joint not a cigarette you weed smokin wannabe lol
 
Back
Top