Ranyo13
ManCausingMayhem
- Joined
- Aug 22, 2009
- Messages
- 981
- Reaction score
- 38
Hey there,
I came up with a script made by me but I snatched out the "Event Timer" from a very old script made by Cykotitan. I hope the script will come in handy to any of you.
The script does the following:
1. Create in actions/other folder: leverwithtimer.lua
2. Copy and paste the script into it:
3. Goto actions.xml then copy and paste this anywhere between <actions> and </actions>:
4. You're done!
Please note that this script has been tested on client version [8.6] only.
(TFS 0.3.6 CryingDamson V8)
Good luck!
I came up with a script made by me but I snatched out the "Event Timer" from a very old script made by Cykotitan. I hope the script will come in handy to any of you.
The script does the following:
- You right click a lever. (Default ItemID: 1945)
- The player gets a message informing him that something has happened.
- An item of your choice present in a position of your choice disappears.
- Sets a timer.
- If the timer hasn't finished yet and the player clicks the lever, he/she gets a message saying "Please wait until the timer resets."
- When timer is finished, the lever switches back to its normal ID.
- The item is created again with a Magic Effect.
1. Create in actions/other folder: leverwithtimer.lua
2. Copy and paste the script into it:
Code:
local function reset(p)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
doCreateItem(387, 1, {x=989, y=998, z=7}) --Item's ID AND Position that you want to remove
doSendMagicEffect({x=989, y=998, z=7}, 34) --Item's Position and magic effect for the item that's going to be removed.
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid ==1946 then
doPlayerSendCancel(cid, "Please wait until the timer resets")
else if item.itemid == 1945 then
doRemoveItem (getTileItemById({x= 989, y=998, z=7}, 387).uid) --Same item's ID AND Position that you want to remove
doSendMagicEffect({x= 989, y=998, z=7}, 2)
doTransformItem(item.uid, 1946)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You hear a noise from the west.") --A message that the player gets informing him that something has happened.
addEvent(reset, 2 * 60 * 1000, toPosition) --Timer for the item to be created again.
else
stopEvent(event)
reset(toPosition)
end
end
return true
end
--Ranyo13
Code:
<action actionid="ID OF YOUR CHOICE" event="script" value="other/leverwithtimer.lua"/>
Please note that this script has been tested on client version [8.6] only.
(TFS 0.3.6 CryingDamson V8)
Good luck!
Last edited: