• 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 FIX] 3 Small Scripts (Decent Scripter Can Fix This)

Tufte

Active Member
Joined
Nov 19, 2007
Messages
652
Reaction score
25
Location
Norway
Sorry for making so many threads but i promise this is the last one xD

Going to update my server tomorrow, and the only thing missing before its ready is this:

Add 20 seconds exhaust on this script. I made it with HEAL exhaust, but its way too low and I dont know how to add custom exhaust! Help please :D

PHP:
local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))

function onStepIn(cid, item, pos)

local dl1pos = {x=774, y=625, z=7, stackpos=253}
local dl2pos = {x=770, y=625, z=7, stackpos=253}
local dl3pos = {x=766, y=625, z=7, stackpos=253}

	if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end
	if isCreature(getThingfromPos(dl1pos)) == 0 and isCreature(getThingfromPos(dl2pos)) == 0 and isCreature(getThingfromPos(dl3pos)) == 0 then
		if item.uid == 1005 and getPlayerStorageValue(cid,97250) == 1 then
				
			doAddCondition(cid, exhaust)
			doSummonCreature("Dragon Lord", dl1pos)
			doSummonCreature("Dragon Lord", dl2pos)
			doSummonCreature("Dragon Lord", dl3pos)
			doCreatureSay(cid, "3 Dragon Lords comming!", TALKTYPE_ORANGE_1)


		elseif item.uid == 1006 and getPlayerStorageValue(cid,97250) == 1 then
			
			doAddCondition(cid, exhaust)
			doSummonCreature("Aladin", dl1pos)
			doSummonCreature("Aladin", dl2pos)
			doSummonCreature("Aladin", dl3pos)
			doCreatureSay(cid, "3 Aladins comming!", TALKTYPE_ORANGE_1)

		elseif item.uid == 1007 and getPlayerStorageValue(cid,97250) == 1 then

			doAddCondition(cid, exhaust)
			doSummonCreature("Demon", dl1pos)
			doSummonCreature("Fire Elemental", dl2pos)
			doSummonCreature("Demon", dl3pos)
			doCreatureSay(cid, "2 Demons and a fire elemental comming!", TALKTYPE_ORANGE_1)

		elseif item.uid == 1008 and getPlayerStorageValue(cid,97250) == 1 then
				
			doAddCondition(cid, exhaust)
			doSummonCreature("Fire Elemental", dl1pos)
			doSummonCreature("Orshabaal", dl2pos)
			doSummonCreature("Fire Elemental", dl3pos)
			doCreatureSay(cid, "Orshabal and fire elementals comming!", TALKTYPE_ORANGE_1)

		elseif item.uid == 1009 and getPlayerStorageValue(cid,97250) == 1 then
				
			doAddCondition(cid, exhaust)
			doSummonCreature("Jasmine", dl1pos)
			doSummonCreature("Sultan", dl2pos)
			doSummonCreature("Jasmines Tiger", dl3pos)
			doCreatureSay(cid, "Sultan and his family coming!", TALKTYPE_ORANGE_1)

		else doPlayerSendTextMessage(cid, 20, 'Only those who have finished the quest can use the power of those tiles!')
		end
	else doPlayerSendTextMessage(cid, 20, 'Already a monster spawned.')
	end
end


Next: I need this script fixed. I made so a wall appears, but it wont remove. Anyone can fix?


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


	wall1 = {x=1016, y=789, z=7, stackpos=1}
	getwall1 = getThingfromPos(wall1)
	delay = 55*10*10


if item.uid == 27828 then
	addEvent(onTime,delay,a) 
	doCreateItem(1533,1,wall1)


function onTime(a)
	
	wall1 = {x=1016, y=789, z=7, stackpos=1}
	getwall1 = getThingfromPos(wall1)
	doRemoveItem(getwall1.uid,1)

end
end
end


Last thing I need help with is this script. I want so when you click on this chest (the blue golden chest) you recieve a key with a action id. Script:

PHP:
Local Key = 2087
Local add = doPlayerAddItem(cid,key,1)

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

doSetItemActionId(add,key)

end


Again, sorry for making all those threads but its the last one I promise!

Thanks for taking time to read/help!
 
You can't just change the formation of the words! "local" cannot be written "Local" and cid is declared in function onUse, so how'd it be possible to place "add" outisde of onUse?
PHP:
local key = 2087 
function onUse(cid) 
    local item = doPlayerAddItem(cid, key, 1) 
    doSetItemActionId(item, key) 
    return TRUE
end

And if you name the variable to "Key" then "key" won't exist, as it's case-sensetive.


It's okay about posting many threads, post 10 each day if necessary, but please!!! Post them in the "Requests & Support" forum instead!
 
it makes the action id to the item id of the chest... i tried to add doSetItemActionId(29003, key)
but then it dosent add anything at all
 
ye but when i use your code the key gets the action id as the key item id, which means i cannot use my own ids which again means i can have max 4 or 5 keys xD
 
doSetItemActionId(item, key)
where it says "key" change to the actionid you want? I didn't know how you wanted it, as you had it that way yourself.
 
Back
Top