xx Kami xx
Retired.
- Joined
- Dec 29, 2012
- Messages
- 509
- Reaction score
- 20
Hello and im looking for a simple script so when you use a lever it spawn's a monster outside the pz area where the lever is pulled i found a script but it isnt the 1 i need maybe someone can mix it around and make it like the script i need?
Will Rep++
I made something similar to what you want, I only used a blackboard instead of a lever, because you can't write on/talk to a lever. So maybe this is usefull too.
creaturescripts.xml
XML:<event type="textedit" name="Demons" event="script" value="demons.lua"/>
Add this to login.lua
Lua:registerCreatureEvent(cid, "Demons")
demons.lua
Lua:local config = { ["1"] = {n = 1}, ["2"] = {n = 2}, ["3"] = {n = 3}, ["4"] = {n = 4}, ["5"] = {n = 5}, ["6"] = {n = 6}, ["7"] = {n = 7}, ["8"] = {n = 8}, ["9"] = {n = 9}, ["10"] = {n = 10} } function onTextEdit(cid, item, newText) if item.uid == 15000 and item.itemid == 1811 then -- add the unique id in the blackboard local x = config[newText] if x then for i = 1, x.n do local pos = {x= math.random(94, 100), y= math.random(114, 120), z=7} -- edit here the locations from the area they spawn in doSummonCreature("Demon", pos) end doPlayerSendTextMessage(cid, 22, ""..newText.." demons spawned.") else doPlayerSendTextMessage(cid, 22, "You can only choose between 1 and 10.") end end return true end
You can write the number of demons you want on the blackboard and they will spawn in the area from local pos.
Btw, if you only want to use a lever, tell me the idea you had about how a player can choose a number while using a lever.
Will Rep++