• 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 Help with script syntax

Taurus

Texass
Joined
Jan 11, 2009
Messages
616
Solutions
2
Reaction score
30
Location
United States
I have tried arranging the syntax for this in every way I know.

Can someone please help me finish the script, it is the final one I need for the whole system to work.

It should work with item 7499 (cigar) and give the different effects to each vocation.

This is now the version of the script I am working on, it works, just won't add any stats to knight and paladin.

Lua:
local condition = createConditionObject(CONDITION_ATTRIBUTES)
 
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000) -- 2 minutes

 
Weed_Text = {{"F**k,", "Im high!"},{"*cough*", "*cough*"},{"Smoke Bud", "Ere day."},{"Shit-", "make my...", "head hot!"},{"*cough*", "*cough*"},{"*hack*", "*cough*"},{"420", "24/7", "365"},{"Smokin", "Smokin", "boogie", "tonight", "and just", "keep on", "tokin", "yeeaaah"},{"420", "24/7", "365"}}
function AnimTexter(parameters)
     doSendAnimatedText(parameters.pos,parameters.text,parameters.color)
     delay10 = delay10+400
end
 
 
 
function onUse(cid,item,frompos,item2,topos)
     local playerpos = getPlayerPosition(cid)
     local color = {}
     local Weed_Text_Div = {}
     local voc = getPlayerVocation(cid)
     delay10 = 0
     local random_number = math.random(1,table.getn(Weed_Text))
	if(voc == 4) then
		condition = createConditionObject(CONDITION_ATTRIBUTES)
		setConditionParam(condition, CONDITION_PARAM_TICKS, 50 * 1000) -- 2 minutes
		setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, 30)
		setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 30)
		setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)
		setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -30)
		else if(voc == 3)then
			condition = createConditionObject(CONDITION_ATTRIBUTES)
			setConditionParam(condition, CONDITION_PARAM_TICKS, 50 * 1000) -- 2 minutes
			setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, 30)
			setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -30)
			else if(voc == 1)or(voc == 2) then
				condition = createConditionObject(CONDITION_ATTRIBUTES)
				setConditionParam(condition, CONDITION_PARAM_TICKS, 50 * 1000) -- 2 minutes
				setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 20)
				setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -10)
			end
	end
     Weed_Text_Div = Weed_Text[random_number]
     if(getPlayerItemCount(cid,item.itemid)>= 1) then
           Weedpos = playerpos
     else
           Weedpos = playerpos
     end
     local parameters1 = { pos = Weedpos, text = Weed_Text_Div[1], color = math.random(150,190)}
     local parameters2 = { pos = Weedpos, text = Weed_Text_Div[2], color = math.random(150,190)}
     local parameters3 = { pos = Weedpos, text = Weed_Text_Div[3], color = math.random(150,190)}
     local parameters4 = { pos = Weedpos, text = Weed_Text_Div[4], color = math.random(150,190)}
     local parameters5 = { pos = Weedpos, text = Weed_Text_Div[5], color = math.random(150,190)}
     local parameters6 = { pos = Weedpos, text = Weed_Text_Div[6], color = math.random(150,190)}
     local parameters7 = { pos = Weedpos, text = Weed_Text_Div[7], color = math.random(150,190)}
     local parameters8 = { pos = Weedpos, text = Weed_Text_Div[8], color = math.random(150,190)}
     local parameters9 = { pos = Weedpos, text = Weed_Text_Div[9], color = math.random(150,190)}
     addEvent(AnimTexter,400,parameters1)
     addEvent(AnimTexter,1000,parameters2)
     addEvent(AnimTexter,1700,parameters3)
     addEvent(AnimTexter,2100,parameters4)
     addEvent(AnimTexter,2700,parameters5)
     addEvent(AnimTexter,3600,parameters6)
     addEvent(AnimTexter,4100,parameters7)
     addEvent(AnimTexter,4600,parameters8)
     addEvent(AnimTexter,5000,parameters9)
 
if doTargetCombatCondition(0, cid, condition, CONST_ME_POFF) == LUA_ERROR then
		return 
 
FALSE
 end
if doCreatureSay(cid, "Toke it up!", TALKTYPE_ORANGE_1) then
if math.random(1, 3) == 1 then
doRemoveItem(item.uid,1) 
doCreatureSay(cid, "Its Cashed.", TALKTYPE_ORANGE_1)
end
end
end
end

Thank you very kindly to anyone who can help.
 
Back
Top