• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

2 More Requests. (Last Requests. >.<) Rep++

Rthom19

New Member
Joined
Mar 2, 2009
Messages
50
Reaction score
0
Location
Australia
k, First one, a creature script.
I need a script that when a certain monster dies it broadcasts a message and summons 5 Creatures in certain Pos.

Example:-
A couple of Players kill a Spider, when the Spider dies it broadcasts something like "The Grandson OF The Old Widow Has Been Killed!" and summons 1 Giant Spider, 1 Tarantula, 1 Spider, 1 Poison Spider, 1 The Old Widow in Pos's
x=100, y=100, z=7.
x=101, y=100, z=7.
x=103, y=100, z=7.
x=104, y=100, z=7.
x=105, y=100, z=7.



Second One(May be difficult):-
k, Well I need a script for a switch, First it checks your Vocation ID, if the Players Vocation ID is 1, 2 or 3 it 2will broadcast a message saying "The Gates To Forgotten Town Have Been Closed!" and will create 5 different items in different spots. One of the 5 will be a Teleport to Pos (x=100, y=100, z=7). If any other Voc(I have alot of custom Vocs) It will broadcast a message "The Gates To Forgotten Town Have Been Opened!" and will remove all 5 items.

If the gates are closed and a Person with Voc 1, 2, 3 trys to pull the switch, It should say "The Gates Are Already Closed" to the player only. Same with all the other Vocs, if the Gates are opened, "The Gates Are Already Open". To the Player only.

Thanks in advance.
 
Last edited:
@Cojrak
What do you mean?

EDIT: The way I capitalize every starting letter? Sorry, its a bad habbit. >.<

EDIT: Changed the text.
 
Last edited:
here is your first script
ok look with the in creature script go to scripts and make a lua file called boss.lua and add this,i will use the monster cat.
Code:
local rlmonster = "cat"   --- name of monster when bee killed the othrs will resp
 
local creature = "rat"
local pos = {x= 95,y=127,z=7}
 
local creature1 = "dog"
local pos1 = {x= 91,y=130,z=7}
 
local creature2 = "lion"
local pos2 = {x= 97,y=131,z=7}
 
local creature3 = "bug"
local pos3 = {x= 95,y=124,z=7}
 
local creature4 = "cave rat"
local pos4 = {x= 95,y=132,z=7}
function onDeath(cid, corpse, killer)
    registerCreatureEvent(cid, "cat")
 if isPlayer then
 doBroadcastMessage("The "..rlmonster.." have been killed")
 doSummonCreature(creature, pos)
 doSummonCreature(creature1, pos1)
 doSummonCreature(creature2, pos2)
 doSummonCreature(creature3, pos3)
 doSummonCreature(creature4, pos4)
 end
  return TRUE
end
srry i didn't make it with table style

then go to creaturescripts.xml and add this
Code:
<event type="death" name="cat" script="boss.lua"/>


In you monster folder-->cat, add this line under </flags>
Code:
<script>
      <event name="cat"/>
</script>

Hope it works.
If i helped Rep+.:D
 
Last edited:
i have made the second script in the way of 2 switches

*the first only vocations of id 1,2,3 can use
broad cast (whatever was closed)
if player used again it will send cancel msg it was already closed
this will creat items

*the other all other voc can use
broad castt (what.. was opened)
if player used again he get cancel msg it was already opened
this will remove items

now i want to know the items created you want all of them be teleporters or what cuz this differ

*or i can make both in 1 lever if you want*
concerning if you want it 1 lever i want to know
will the player of voc 1,2,3 will always be the first to use the lever so the items wil be created
then player of other voc will come and use it after them to remove items??
 
Last edited:
yeah, 1 switch would be good.
The items will already be on the server when its reset, so the gates have to be opened first, by all the other vocs.

Also only 1 of the 5 items will be a teleport.

The rest others, walls, stones, etc..

Thanks.
 
nah i don't get it you need when 1.2.3 voc use the lever items to be created or what cause you say items will already be in map so what is the use for items being creeated lol.And anothr thing why you not only remove the items from the map and lever will do it work.And as you said do you want me to make the lever used by the other voc first then the 1,2,3 voc be able to use it when gated are opened?
 
Any way you mean that when server resset and if the players of the 1,2,3 voc were the first to pull lever they will ge tmsg Gates are already closed but after other voc pull lever and they try pull again items will be created and brod cast msg?
 
k, ill try explain my best..
okay, lets say there is 3 stones already on the map.
One in Pos x100, y100, z7,
One in Pos x100, y101, z7 and
One in Pos x100, y102, z7.

k lets say theres 4 teams,
Black Team - Vocs 1, 2 and 3
Blue Team - Vocs 4, 5 and 6
Yellow Team - Vocs 7, 8 and 9
Red Team - Vocs 10, 11 and 12
And each team has their own town.

The stones will be blocking off the entrance to black teams base.
If a black team member trys to pull the switch when the items are already there, it will send the player a cancel message.
However if there is no items there and a black team member pulls it it will create the items again and broadcast "The Gates To Black Teams Base Have Been Closed!".

If Any other team pulls the switch it will broadcast "The Gates To Black Teams Base Has Been Opened!" and if the items are already gone it will send a cancel message to him/her.

Thats prolly the best i can explain it. :/

Or if you cant do it that way ill just take items off the map and make it so the other teams(not Black) has to pull the switch first.. therefore creating the items..
 
ok,maybe i made it in a bad way (not short),this script for voc(1,2,3) and the others do open gates.But yea it works great here it is
Put this in action.xml
Code:
<action actionid="1900" event="script" value="lev.lua"/>
Then creat file called lev.lua And put this in it

Code:
[COLOR=blue][B]local[/B][/COLOR] tppos [COLOR=navy]=[/COLOR] {x[COLOR=navy]=[/COLOR][COLOR=darkorange]1000[/COLOR], y[COLOR=navy]=[/COLOR][COLOR=darkorange]1000[/COLOR], z[COLOR=navy]=7[/COLOR], stackpos=[COLOR=darkorange]1[/COLOR]} [COLOR=green]---just change the x,y,z to place where teleport will be created in thi8s is very important[/COLOR]
[COLOR=blue][B]local[/B][/COLOR] tp [COLOR=navy]=[/COLOR] {x=[COLOR=darkorange]1004[/COLOR], y=[COLOR=darkorange]1000[/COLOR], z=[COLOR=darkorange]7[/COLOR]}  [COLOR=green]--place where players will be tped[/COLOR]
 
[COLOR=blue][B]local[/B][/COLOR] items =[COLOR=darkorange] 2650[/COLOR]          [COLOR=green] -- item id that will be dreated item number <1>[/COLOR]
[COLOR=blue][B]local[/B][/COLOR] pos = {x=[COLOR=darkorange]1001[/COLOR], y=[COLOR=darkorange]1000[/COLOR], z=[COLOR=darkorange]7[/COLOR]}  [COLOR=green]--place where it will be created[/COLOR]
[COLOR=blue][B]local[/B][/COLOR] poss = {x=[COLOR=darkorange]1001[/COLOR], y=[COLOR=darkorange]1000[/COLOR], z=[COLOR=darkorange]7[/COLOR], stackpos=[COLOR=darkorange]1[/COLOR]}   [COLOR=green]--here change the x,y,z only accordin to the place where item will be created<pos> [/COLOR]
 
[COLOR=blue][B]local[/B][/COLOR] item1 = [COLOR=darkorange]2749[/COLOR]
[COLOR=blue][B]local[/B][/COLOR] pos1 = {x=[COLOR=darkorange]1002[/COLOR], y=[COLOR=darkorange]1000[/COLOR], z=[COLOR=darkorange]7[/COLOR]}
[COLOR=blue][B]local[/B][/COLOR] poss1 = {x=[COLOR=darkorange]1002[/COLOR], y=[COLOR=darkorange]1[/COLOR][COLOR=darkorange]000[/COLOR], z=[COLOR=darkorange]7[/COLOR], stackpos=[COLOR=darkorange]1[/COLOR]}
 
[COLOR=blue][B]local [/B][/COLOR]item2 = [COLOR=darkorange]2284[/COLOR]
[COLOR=blue][B]local[/B][/COLOR] pos2 = {x=[COLOR=darkorange]1003[/COLOR], y=[COLOR=darkorange]1000[/COLOR], z=[COLOR=darkorange]7[/COLOR]}
[COLOR=blue][B]local[/B][/COLOR] poss2 ={x=[COLOR=darkorange]1003[/COLOR], y=[COLOR=darkorange]1000[/COLOR], z=[COLOR=darkorange]7[/COLOR], stackpos=[COLOR=darkorange]1[/COLOR]}
 
[COLOR=blue][B]local[/B][/COLOR] item3 = [COLOR=darkorange]2285[/COLOR]
[COLOR=blue][B]local [/B][/COLOR]pos3 = {x=[COLOR=darkorange]1000[/COLOR], y=[COLOR=darkorange]1001[/COLOR], z=[COLOR=darkorange]7[/COLOR]}
[COLOR=blue][B]local[/B][/COLOR] poss3 ={x=[COLOR=darkorange]1000[/COLOR], y=[COLOR=darkorange]1001[/COLOR], z=[COLOR=darkorange]7[/COLOR], stackpos=[COLOR=darkorange]1[/COLOR]}
 
[B][COLOR=blue]function[/COLOR][/B] onUse(cid, item, fromPosition, itemEx, toPosition)
   [B][COLOR=blue]local[/COLOR][/B] iteeeemm = getThingFromPos(tppos)
   [COLOR=blue][B]local[/B][/COLOR] itemm = getThingFromPos(poss)
   [COLOR=blue][B]local[/B][/COLOR] itemmm = getThingFromPos(poss1)
   [COLOR=blue][B]local[/B][/COLOR] iteemm = getThingFromPos(poss2)
   [COLOR=blue][B]local[/B][/COLOR] iteeem = getThingFromPos(poss3) 
 [COLOR=blue][B]if[/B][/COLOR] iteeeemm.itemid == [COLOR=darkorange]1387[/COLOR] [COLOR=blue][B]then[/B][/COLOR]
   [B][COLOR=blue]if[/COLOR][/B] getPlayerVocation(cid) > [COLOR=darkorange]3[/COLOR] [COLOR=blue][B]then [/B][/COLOR]
          doBroadcastMessage("[COLOR=silver]The Gates TO Forgotten Town Have Been Opened[/COLOR][COLOR=silver]![/COLOR]")
    doRemoveItem(iteeeemm.uid,[COLOR=darkorange]1[/COLOR])
    doRemoveItem(itemm.uid,[COLOR=darkorange]1[/COLOR])
    doRemoveItem(itemmm.uid,[COLOR=darkorange]1[/COLOR])
    doRemoveItem(iteemm.uid,[COLOR=darkorange]1[/COLOR])
    doRemoveItem(iteeem.uid,[COLOR=darkorange]1[/COLOR])
    [COLOR=blue][B]elseif[/B][/COLOR] getPlayerVocation(cid) <= [COLOR=darkorange]3[/COLOR] and getPlayerVocation(cid) ~= [COLOR=darkorange]0[/COLOR] then
           doPlayerSendCancel(cid, "[COLOR=silver]Gates are already Closed[/COLOR][COLOR=silver]![/COLOR]")
 [COLOR=blue][B]   end[/B][/COLOR]
[COLOR=blue][B]end[/B][/COLOR]   
 [COLOR=blue][B]local[/B][/COLOR] iteeeemm = getThingFromPos(tppos)
 [B][COLOR=blue]if[/COLOR][/B] iteeeemm.itemid ~= [COLOR=darkorange]1387[/COLOR] [COLOR=blue][B]then[/B][/COLOR]
  [COLOR=blue][B]  if[/B][/COLOR] getPlayerVocation(cid) <= [COLOR=darkorange]3[/COLOR] and getPlayerVocation(cid) ~= [COLOR=darkorange]0[/COLOR] then
       doBroadcastMessage("[COLOR=silver]The Gates To Forgotten Town Have Been CLOSED[/COLOR][COLOR=silver]![/COLOR]")
       teleport = doCreateTeleport([COLOR=darkorange]1387[/COLOR], tp, tppos)
       doCreateItem(items,[COLOR=darkorange]1[/COLOR],pos)
       doCreateItem(item1,[COLOR=darkorange]1[/COLOR],pos1)
       doCreateItem(item2,[COLOR=darkorange]1[/COLOR],pos2)
       doCreateItem(item3,[COLOR=darkorange]1[/COLOR],pos3)
    [COLOR=blue][B]elseif[/B][/COLOR] getPlayerVocation(cid) > [COLOR=darkorange]3[/COLOR] [COLOR=blue][B]then[/B][/COLOR]  
             doPlayerSendCancel(cid, "[COLOR=silver]Gates are already Opened[/COLOR]")
    [COLOR=blue][B]end[/B][/COLOR]
[COLOR=blue][B]end[/B][/COLOR]
 
[COLOR=blue][B]end[/B][/COLOR]

If you want more explanation on how to use it or to set positions etc... , msg me.
 
Last edited:
Ill test it later.

but from what i can see you used more than or less that for the vocations..

Problem is i want a switch for each team so like for voc 4, 5 and 6.. so will i have to name every vocation id?
 
Okay. I Tested and there is a few things that need fixing..

First off,
I logged on my test char(Voc 1) and i pulled the switch, the items were created, and it broadcasted the message, which is great. But on that same char i could pull the switch over and over and it kept broadcasting and creating more items..

Then i logged on my other test char(Voc 4) and when I pulled the switch instead of removing the items it sent the cancel message..

:/
 
look writem me here the place where you want the tp to be created in i mean in x,y,z and paste me the changes you made in script
causei tested it and works great
 
look man give me loacation of every item with id i will make it to you cause problem is with you ,probably you made few wrong things when you edited the script
 
here is your first script
ok look with the in creature script go to scripts and make a lua file called boss.lua and add this,i will use the monster cat.
Code:
local rlmonster = "cat"   --- name of monster when bee killed the othrs will resp
 
local creature = "rat"
local pos = {x= 95,y=127,z=7}
 
local creature1 = "dog"
local pos1 = {x= 91,y=130,z=7}
 
local creature2 = "lion"
local pos2 = {x= 97,y=131,z=7}
 
local creature3 = "bug"
local pos3 = {x= 95,y=124,z=7}
 
local creature4 = "cave rat"
local pos4 = {x= 95,y=132,z=7}
function onDeath(cid, corpse, killer)
    registerCreatureEvent(cid, "cat")
 if isPlayer then
 doBroadcastMessage("The "..rlmonster.." have been killed")
 doSummonCreature(creature, pos)
 doSummonCreature(creature1, pos1)
 doSummonCreature(creature2, pos2)
 doSummonCreature(creature3, pos3)
 doSummonCreature(creature4, pos4)
 end
  return TRUE
end
srry i didn't make it with table style

then go to creaturescripts.xml and add this
Code:
<event type="death" name="cat" script="boss.lua"/>


In you monster folder-->cat, add this line under </flags>
Code:
<script>
      <event name="cat"/>
</script>

Hope it works.
If i helped Rep+.:D
do this work ?
 
Back
Top Bottom