WhiteOut
OT Builder
Very easy script but I haven't scripted in quiet a while and I know I'm doing something wrong.
TFS 0.3.6
I have two scripts that work in one quest and its a rather simple idea and I cannot get it to work.
Action Scripts
This script suppose to take the item, give you a storage (10054), if you have the storage you can't use the item till storage is gone. Item disappeared when used.
This script is for the door (door unique ID 5809) if you have the storage (storage 10054) from the previous item (itemid 5809) once you right click door it then spawns a monster and door disappears while blocking other door for access.
Thanks For Viewing
~Sin
TFS 0.3.6
I have two scripts that work in one quest and its a rather simple idea and I cannot get it to work.
Action Scripts
This script suppose to take the item, give you a storage (10054), if you have the storage you can't use the item till storage is gone. Item disappeared when used.
Code:
function onUse(cid, item, frompos, item2, topos)
if (item.itemid == 5809) then
hasKey = getPlayerStorageValue(cid, 10054)
elseif ((hasKey == -1) or (hasKey == 0)) then
print(":: Blah Key used by " .. getPlayerName(cid))
doPlayerSendTextMessage(cid, 16, "Blah Blah Blah.")
doPlayerSendTextMessage(cid, 16, "Blah Blah Blah.")
doPlayerSendTextMessage(cid, 16, "Blah Blah Blah.")
doPlayerSendTextMessage(cid, 24, "Blah Blah Blahhhhh.")
doPlayerRemoveItem(cid, 5809, 1)
setPlayerStorageValue(cid, 10054, 1)
if
doPlayerSendTextMessage(cid, 16, "Blah Blah Blahh.")
doPlayerSendTextMessage(cid, 24, "Blah Blah.")
end
end
This script is for the door (door unique ID 5809) if you have the storage (storage 10054) from the previous item (itemid 5809) once you right click door it then spawns a monster and door disappears while blocking other door for access.
Code:
function onUse(cid, item, frompos, item2, topos)
if (item.uid == 5809) then
hasKey = getPlayerStorageValue(cid, 10054)
if ((hasKey == -1) or (hasKey == 0)) then
doPlayerSendTextMessage(cid,22,"Blah Blah Blah.")
else
setPlayerStorageValue(cid, 10054, 0)
doorPos = {x=163, y=71, z=8, stackpos=1}
door = getThingfromPos(doorPos)
doTransformItem(door.uid, 1196)
doorPos = {x=169, y=68, z=8, stackpos=1}
door = getThingfromPos(doorPos)
doRemoveItem(door.uid, 5809)
sBlahPos = {x=165, y=69, z=8, stackpos=1}
doSummonCreature("skiller", sBlahPos)
doPlayerSendTextMessage(cid, 16, "Blah Blah.")
doPlayerSendTextMessage(cid, 24, "Blah Blah.")
end
end
end
Thanks For Viewing
~Sin