Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 746
- Solutions
- 9
- Reaction score
- 125
Hello, i've made this script on creaturesripts, set the storage value to the door, and the script on creaturescripts.xml but i dont know why its not working! Any help please? Im using TFS 1.2
door actionid=21983
boss door.lua
creaturescript.xml
The script is supposed to let you open the door for 1 minute to everybody who hitted the boss, after 1 minute, you have to kill the boss again to let you open the door.
i've got a demon skeleton close to the door with a spawn. So, what im doing wrong?
door actionid=21983
boss door.lua
Code:
local config = {
storage = 21983,
exstorage = 21982,
}
function onDeath(cid, creature, damage, flags)
if player:getStorageValue(config.storage) == tonumber(os.date("%w")) and player:getStorageValue(config.exstorage) > os.time() then
return player:sendCancelMessage("You can't access the door until you kill the boss.")
end
if getPlayerStorageValue(cid, 21983) == 0 and (bit.band(flags, 1)) == 1 and isMonster(target) and getCreatureName(cid).target == 'demon skeleton' then
text = "You have received " .. text .. "."
player:setStorageValue(config.storage, tonumber(os.date("%w")))
player:setStorageValue(config.exstorage, os.time() + 1*60)
end
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
return true
end
creaturescript.xml
Code:
<event type="death" name="boss door" script="boss door.lua"/>
i've got a demon skeleton close to the door with a spawn. So, what im doing wrong?
Last edited: