• 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:
if is player (maybe if he is player) and it dfoesnt matter i put it cuz i like to put if in every script and just try it it will work fine msg will broadcsted and monster will b summoned no errors will appear.
 
Omg... it was sarcazm...

Should be:
Code:
if (isPlayer(cid) == TRUE) then
or:
Code:
if isPlayer(cid) then

^.-
 
i donno whennever i try to make it like that it doesnt work and doenst givve error when i put that (cid) i donno why .So i just made it like that and it give me no errors the guy asked for a working script and here is one :).Any way i like that you answer on every question. :) and that thing you put in flowrence request that say make bag with items in it it gives me error lol the bag is summoned but nthng in it and gives errors

can you check if the other script i made here is fine lol
 
Code:
function onKill(cid, target)
	if (string.lower(getCreatureName(target)) ~= "Boss") then
		return TRUE
	end

	local positions = {
		{x = , y = , z =},
		{x = , y = , z =},
		{x = , y = , z =},
		{x = , y = , z =}
	}
	local monsters = {"Monster1", "Monster2", "Monster3", "Monster4")

	if (#positions ~= #monsters) then
		return TRUE
	end

	for i = 1, #positions do
		doSummonCreature(monsters[i], positions[i])
	end

	doBroadcastMessage("yayayyaya boss died!!!")
	return TRUE
end
 
~~~
The for statement has two forms: one numeric and one generic.

The numeric for loop repeats a block of code while a control variable runs through an arithmetic progression.
 
The script with the Switch making the items, works..
but its all wrong lol :/

btw Damadgerz the only thing i edited in the script, was the pos's, so i didnt make a typo or change anything around..
 
Well, The script loads up and works and all..
but if any voc = 3 and under it broadcasts the right thing.. it adds the right things.. but you can keep clicking the leaver it doesnt send the player a cancel message instead if a player with voc 4 or higher trys to pull it it send him/her the cancel message..

And one more thing the item you have to use, is a switch, not a teleport like you have it lol
 
Last edited:
ok hre is the on ethat works
Code:
local tppos = {x=1000, y=1003, z=7, stackpos=1}  ---just change the x,y,z to place where teleport will be created in
local tp = {x=1000, y=1000, z=7}  --place where players will be tped
 
local items = 1285           -- item id that will be dreated item number <1>
local pos = {x=998, y=1003, z=7}  --place where it will be created
local poss = {x=998, y=1003, z=7, stackpos=1}   --here change the x,y,z only accordin to the place where item will be created<pos> 
 
local item1 =1285
local pos1 = {x=999, y=1003, z=7}
local poss1 = {x=999, y=1003, z=7, stackpos=1}
 
local item2 = 1285
local pos2 = {x=1002, y=1003, z=7}
local poss2 ={x=1002, y=1003, z=7, stackpos=1}
 
local item3 = 1285
local pos3 = {x=1001, y=1003, z=7}
local poss3 ={x=1001, y=1003, z=7, stackpos=1}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local iteeeemm = getThingFromPos(tppos)
    local itemm = getThingFromPos(poss)
    local itemmm = getThingFromPos(poss1)
    local iteemm = getThingFromPos(poss2)
    local iteeem = getThingFromPos(poss3)
    if iteeeemm.itemid == 1387 then
      if getPlayerVocation(cid) ~= 1 and getPlayerVocation(cid) ~= 2 and getPlayerVocation(cid) ~= 3 then
         doBroadcastMessage("The Gates TO Forgotten  Town Have Been Opened!")
         doRemoveItem(iteeeemm.uid,1)
         doRemoveItem(itemm.uid,1)
         doRemoveItem(itemmm.uid,1)
         doRemoveItem(iteemm.uid,1)
         doRemoveItem(iteeem.uid,1)
      elseif getPlayerVocation(cid) == 1 or 2 or 3 then
          doPlayerSendCancel(cid, "Gates are already Closed!")
      end
 
 
    elseif iteeeemm.itemid ~= 1387 then
       if getPlayerVocation(cid) ~= 1 and getPlayerVocation(cid) ~= 2 and getPlayerVocation(cid) ~= 3 then
          doPlayerSendCancel(cid, "Gates are already Opened")
       elseif getPlayerVocation(cid) == 1 or 2 or 3 then
               doBroadcastMessage("The Gates To Forgotten Town Have Been CLOSED!")
               teleport = doCreateTeleport(1387, tp, tppos)
               doCreateItem(items,1,pos)
               doCreateItem(item1,1,pos1)
               doCreateItem(item2,1,pos2)
               doCreateItem(item3,1,pos3)
 
 
       end
    end
end
 
ok hre is the on ethat works
Code:
local tppos = {x=1000, y=1003, z=7, stackpos=1}  ---just change the x,y,z to place where teleport will be created in
local tp = {x=1000, y=1000, z=7}  --place where players will be tped
 
local items = 1285           -- item id that will be dreated item number <1>
local pos = {x=998, y=1003, z=7}  --place where it will be created
local poss = {x=998, y=1003, z=7, stackpos=1}   --here change the x,y,z only accordin to the place where item will be created<pos> 
 
local item1 =1285
local pos1 = {x=999, y=1003, z=7}
local poss1 = {x=999, y=1003, z=7, stackpos=1}
 
local item2 = 1285
local pos2 = {x=1002, y=1003, z=7}
local poss2 ={x=1002, y=1003, z=7, stackpos=1}
 
local item3 = 1285
local pos3 = {x=1001, y=1003, z=7}
local poss3 ={x=1001, y=1003, z=7, stackpos=1}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local iteeeemm = getThingFromPos(tppos)
    local itemm = getThingFromPos(poss)
    local itemmm = getThingFromPos(poss1)
    local iteemm = getThingFromPos(poss2)
    local iteeem = getThingFromPos(poss3)
    if iteeeemm.itemid == 1387 then
      if getPlayerVocation(cid) ~= 1 and getPlayerVocation(cid) ~= 2 and getPlayerVocation(cid) ~= 3 then
         doBroadcastMessage("The Gates TO Forgotten  Town Have Been Opened!")
         doRemoveItem(iteeeemm.uid,1)
         doRemoveItem(itemm.uid,1)
         doRemoveItem(itemmm.uid,1)
         doRemoveItem(iteemm.uid,1)
         doRemoveItem(iteeem.uid,1)
      elseif getPlayerVocation(cid) == 1 or 2 or 3 then
          doPlayerSendCancel(cid, "Gates are already Closed!")
      end
 
 
    elseif iteeeemm.itemid ~= 1387 then
       if getPlayerVocation(cid) ~= 1 and getPlayerVocation(cid) ~= 2 and getPlayerVocation(cid) ~= 3 then
          doPlayerSendCancel(cid, "Gates are already Opened")
       elseif getPlayerVocation(cid) == 1 or 2 or 3 then
               doBroadcastMessage("The Gates To Forgotten Town Have Been CLOSED!")
               teleport = doCreateTeleport(1387, tp, tppos)
               doCreateItem(items,1,pos)
               doCreateItem(item1,1,pos1)
               doCreateItem(item2,1,pos2)
               doCreateItem(item3,1,pos3)
 
 
       end
    end
end


This Script Works, just not for me.. anyone know why? I dont get errors either..

im using Crying Damson 0.3.5
 
humm , i donnot why it didnt worked in your server as you saw when i made restart i switched the servers to the same one you use and you checkecd and it worked great maybe somthng with you voc script i guess.lol.



try to paste here your vocation script and i will check
 
Back
Top Bottom