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

dragondarc

New Member
Joined
Apr 7, 2009
Messages
14
Reaction score
0
Code:
-- local pause = 1000/2 -- 0.5 sec.
-- local FirstItem = {x=98, y=114, z=15, stackpos=255}
local firstMonsterSpawn = {x=99, y=113, z=15}
-- local GetID = getThingfromPos(FirstItem)




function onUse(cid, item, fromPosition, itemEx, toPosition)
		-- if GetID.itemid == 2000 then
		doSummonCreature("Rotworm", firstMonsterSpawn)
		-- doRemoveItem(GetID,1)
		doSendMagicEffect(firstMonsterSpawn, CONST_ME_POFF)
		-- addEvent(pause)
                     else
        doPlayerSendCancel(cid, "Wrong item.")
	end
-- end

trying to finish this code, and have since realise im a terrible scripter, but im trying! was wondering if anyone could help me finish it or tell me where i went wrong, (yes i know about the -- in the script, i put them there because they are currently functions that are not working in the script so far it spawns a monster, and sends an effect to the 1st spot it tries to spawn at lol.
 
Code:
-- local pause = 1000/2 -- 0.5 sec.
-- local FirstItem = {x=98, y=114, z=15, stackpos=255}
local firstMonsterSpawn = {x=99, y=113, z=15}
-- local GetID = getThingfromPos(FirstItem)




function onUse(cid, item, fromPosition, itemEx, toPosition)
		-- if GetID.itemid == 2000 then
		doSummonCreature("Rotworm", firstMonsterSpawn)
		-- doRemoveItem(GetID,1)
		doSendMagicEffect(firstMonsterSpawn, CONST_ME_POFF)
		-- addEvent(pause)
                     else
        doPlayerSendCancel(cid, "Wrong item.")
	end
-- end

trying to finish this code, and have since realise im a terrible scripter, but im trying! was wondering if anyone could help me finish it or tell me where i went wrong, (yes i know about the -- in the script, i put them there because they are currently functions that are not working in the script so far it spawns a monster, and sends an effect to the 1st spot it tries to spawn at lol.

maybe this should work: (Couldn't test it)
Lua:
local pause = 1000/2 -- 0.5 sec.
local FirstItem = {x=98, y=114, z=15, stackpos=255}
local firstMonsterSpawn = {x=99, y=113, z=15}
local GetID = getThingfromPos(FirstItem)




function onUse(cid, item, fromPosition, itemEx, toPosition)
		if GetID.itemid == 2000 then
		doSummonCreature("Rotworm", firstMonsterSpawn)
		doRemoveItem(GetID,1)
		doSendMagicEffect(firstMonsterSpawn, CONST_ME_POFF)
		addEvent(pause)
                     else
        doPlayerSendCancel(cid, "Wrong item.")
	end
return TRUE
end
 
maybe this should work: (Couldn't test it)
Lua:
local pause = 1000/2 -- 0.5 sec.
local FirstItem = {x=98, y=114, z=15, stackpos=255}
local firstMonsterSpawn = {x=99, y=113, z=15}
local GetID = getThingfromPos(FirstItem)




function onUse(cid, item, fromPosition, itemEx, toPosition)
		if GetID.itemid == 2000 then
		doSummonCreature("Rotworm", firstMonsterSpawn)
		doRemoveItem(GetID,1)
		doSendMagicEffect(firstMonsterSpawn, CONST_ME_POFF)
		addEvent(pause)
                     else
        doPlayerSendCancel(cid, "Wrong item.")
	end
return TRUE
end

bump :D
 
Should work, also I don't know why you have the pause in there.. what are you trying to achieve with it?


Lua:
local config = {
	firstItem = {x = 98, y = 114, z = 15, stackpos = 255},
	firstMonsterSpawn = {x = 99, y = 113, z = 13}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		local thing = getThingFromPos(config.firstItem)
		if thing.itemid == 2000 then
			doCreateMonster("Rotworm", config.firstMonsterSpawn)
			doSendMagicEffect(config.firstMonsterSpawn, CONST_ME_POFF)
			doRemoveItem(thing.uid)
		else
			doPlayerSendCancel(cid, "Wrong Item!")
		end
	doTransformItem(item.uid, 1945)	
	end
	return true
end
 
Last edited:
i want to make it so that theres a wait time between uses, so that people cant just crash my server with it XD i just didnt realy know the command for adding wait time, i was taking bits from other scripts like the anni and such to try and piece together something that worked without realy knowing what i was doing i guess =S.

When i tried using your script synthetic, the lever just imploded and dissapeared without creating the rotworm or anything, 0.o that confused the hell out of me when it happened XD (as the aim is just to remove the item at
firstItem = {x = 98, y = 114, z = 15, stackpos = 255}
)
thanks for your help tho =)
 
Last edited:
i want to make it so that theres a wait time between uses, so that people cant just crash my server with it XD i just didnt realy know the command for adding wait time, i was taking bits from other scripts like the anni and such to try and piece together something that worked without realy knowing what i was doing i guess =S.

When i tried using your script synthetic, the lever just imploded and dissapeared 0.o that confused the hell out of me when it happened XD (as the aim is just to remove the item at )
thanks for your help tho =)


Edited the post, try again. :D
 
i want to make it so that theres a wait time between uses, so that people cant just crash my server with it XD i just didnt realy know the command for adding wait time, i was taking bits from other scripts like the anni and such to try and piece together something that worked without realy knowing what i was doing i guess =S.

When i tried using your script synthetic, the lever just imploded and dissapeared without creating the rotworm or anything, 0.o that confused the hell out of me when it happened XD (as the aim is just to remove the item at )
thanks for your help tho =)

Do you want to make a global exhaust or only a single player exhaust ?
I mean, do you want the exhaust time to be in the lever so that no one would be able to use it, or do you want the exhaust to be on the player so that he have to wait to use the lever again but another player could use it ?
 
Edited again, try it

Synthetic, I didn't test your script, Im just curious and want to learn from you..
On the script you just updated, shouldn't there be a
Lua:
doTransformItem(item.uid, 1946)

on the part of the script that executes if the conditions return true ?

I'm just curious = )
Thanks already for the explanation
 
Synthetic, I didn't test your script, Im just curious and want to learn from you..
On the script you just updated, shouldn't there be a
Lua:
doTransformItem(item.uid, 1946)

on the part of the script that executes if the conditions return true ?

I'm just curious = )
Thanks already for the explanation

Well item.uid = the item you're using in the script. So the 'item.uid' will be ID 1946, so you want it to be turned back into 1945 before the script is finished
 
i want to make it so that theres a wait time between uses, so that people cant just crash my server with it XD i just didnt realy know the command for adding wait time, i was taking bits from other scripts like the anni and such to try and piece together something that worked without realy knowing what i was doing i guess =S.

When i tried using your script synthetic, the lever just imploded and dissapeared without creating the rotworm or anything, 0.o that confused the hell out of me when it happened XD (as the aim is just to remove the item at )
thanks for your help tho =)

Actions have a 200ms delay by default in the config to prevent the spam you are worried about.

Change this in the config lua if you think 200ms is not enough:
Code:
-- Item usage
timeBetweenActions = 200
timeBetweenExActions = 1000
 
global exhaust, if it was at all possible is what im looking for, and the lever just takes away items without moving or spawning creature, its realy bad that when i used to host a server a couple of years ago i managed to make this scrit myself but now im completely baffled by it =S
 
Last edited:
cryingdamson 0.3.6 (8.60) V5
thats currently running a modified naxed map.... XD
if any of that helps?

[21/08/2012 01:14:27] [Error - Action Interface]
[21/08/2012 01:14:27] data/actions/scripts/other/spawnlever1.lua:eek:nUse
[21/08/2012 01:14:27] Description:
[21/08/2012 01:14:27] (luaDoCreateMonster) Cannot create monster: Rotworm

is all the console tells me about it? XD
 
Last edited:
Then it can't create the monster because either A) there isn't enough room, or the tile you're using isn't a proper one that allows monsters to be spawned onto it, or either B) the monster "Rotworm" doesn't exist in your server.
 
Back
Top