- Joined
- May 23, 2010
- Messages
- 185
- Reaction score
- 23
Hi, how can i make a script that you can only use the item if you had killed gs, demon and behemoth? rep+
registerCreatureEvent(cid, "KillRequirement")
<event type="kill" name="KillRequirement" event="script" value="killrequirement.lua"/>
<script>
<event name="KillRequirement"/>
</script>
function onKill(cid, target, lastHit)
local demonstorage = 10001
local demonkilled = getPlayerStorageValue(cid,demonstorage)
local creature = getCreatureName(target)
if creature == "demon" then
if demonkilled == -1 then
doCreatureSetStorage(cid, demonstorage, 1)
end
end
end
local ratstorage = 10002
local ratkilled = getPlayerStorageValue(cid,demonstorage)
demonkilled = getPlayerStorageValue(cid,demonstorage)
if creature == "Demon" then
if demonkilled == -1 then
doCreatureSetStorage(cid, demonstorage, 1)
end
end
if creature == "rat" then
if ratkilled == -1 then
doCreatureSetStorage(cid, ratstorage, 1)
end
end
<script>
<event name="KillRequirement"/>
</script>
<!-- Kill Requirement Lever -->
<action actionid="10203" event="script" value="killrequirement.lua"/>
function onUse(cid, item, frompos, item2, topos)
local demonstorage = 10001
local demonteleport = {x=1133, y=959, z=7} --Location to teleport to on the map if you pull the lever
--Demon Kill
if item.uid == 10001 then
queststatus = getPlayerStorageValue(cid,demonstorage)
if queststatus == 1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have defeated a demon, therefore you can pass.")
doTeleportThing(cid,demonteleport)
doSendMagicEffect(demonteleport,10)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to defeat a demon to use this lever.")
end
end
end