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

Easy Script ?

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Dont know if this is the right place to post but i will try ..
I need a scrpit so when you press on the switch , a stone/tree will remove ?

I think its pretty easy script .. but im not a scrpiter so i dont know how to make it work ...
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local gatepos = {x=125, y=430, z=8, stackpos=1}[COLOR="Red"]<!--Coordinates of stone-->[/COLOR]
local getgate = getThingfromPos(gatepos)
	if item.itemid == 1945 and item.actionid == 7449[COLOR="#ff0000"](actionid what you used on switch)[/COLOR] and getgate.itemid == 5747[COLOR="#ff0000"](itemid of stone\three~)[/COLOR] then
	doRemoveItem(getgate.uid,1)
	doTransformItem(item.uid,item.itemid+1)
	doPlayerSendTextMessage(cid, 22, "Blablabla!")[COLOR="#ff0000"](text)[/COLOR]
	elseif item.itemid == 1946 then
	doTransformItem(item.uid,item.itemid-1)
        doCreateItem(5747, 1, gatepos)[COLOR="Red"](enter itemid again)[/COLOR]
	end
return TRUE
end

delete all red text and config ;>
 
hmm i have fix it now i test it and when i use the switch the text come ''...''

but the stone dont remove ?
here is the stone :
05:13 You see a stone.
ItemID: [1304].
Position: [X: 119] [Y: 379] [Z: 5].

here is the script :

C:\ot\data\actions\scripts\other\stone.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)
local gatepos = {x=119, y=379, z=5, stackpos=1}
local getgate = getThingfromPos(gatepos)
if item.itemid == 1945 and item.actionid == 7449 and getgate.itemid == 1304 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
doPlayerSendTextMessage(cid, 22, "...")
elseif item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
doCreateItem(1304, 1, gatepos)
end
return TRUE
end

in action :
<action actionid="7449" script="other/stone.lua" />

EDIT :
Here is the switch :
05:17 You see a switch.
ItemID: [1946].
ActionID: [7449].
Position: [X: 119] [Y: 382] [Z: 5].
 
any errors?
maybe try with local gatepos = {x=119, y=379, z=5, stackpos=255}
 
Its because you have placed switch 1946 witch is creating item, so when you use it, you are creating an item over item and when using the switch 1945 then you are still left with one of them. :p
 
use another switch, not 1946, use 1945.
Thanks Marcinek~ xD didn't notised this
 
Change this:

Code:
if item.itemid == 1945 and item.actionid == 7449 and getgate.itemid == [B][COLOR="Blue"]5747[/COLOR][/B] then

To itemid 1304
 
Back
Top