• 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!

[Request] two "lore,quest/teleport" script.

Andréew

Humble mapper.
Joined
Apr 14, 2015
Messages
833
Solutions
2
Reaction score
1,929
Location
Sweden
I would like some help scripting,
my idea is when you click this coffin ( Id:1419) a monster will spawn,
i also want it to say something like when you right click a quest chest and it says " You found bla bla bla "..

i also wonder if it is possible to make it so this mammoth totem ( Id:6973) can be used as a portal, like if you right click it you teleport to x=? y=? z=?

this would be so awesome if anyone was able to help me get going on this script!
Thank you anyway! :)
 
Thanks mate! that was very helpful, however! i did some changes in the script or was atleast trying to, trying to learn and all that i come across this error

[16/04/2015 03:32:06] >> Loading script systems
[16/04/2015 03:32:07] [Error - LuaScriptInterface::loadFile] data/actions/scripts/myQuests/bossSorcerer.lua:27: 'end' expected (to close 'function' at line 1) near 'else'
[16/04/2015 03:32:07] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/myQuests/bossSorcerer.lua)
[16/04/2015 03:32:07] data/actions/scripts/myQuests/bossSorcerer.lua:27: 'end' expected (to close 'function' at line 1) near 'else'

and here is my code

function onUse(cid, item, frompos, itemEx, topos, item2)
if item.uid == 10010 then
queststatus = getPlayerStorageValue(cid,10010)

local fromPos = {x = toPosition.x - 207, y = toPosition.y - 168, z = toPosition.z - 10}
local toPos = {x = toPosition.x + 207, y = toPosition.y + 168, z = toPosition.z + 10}

local amount = 0
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
local monster = getTopCreature({x=x,y=y,z=z}).uid
if(isCreature(monster) == TRUE) then
if getCreatureName(monster) == "Vampire" then
amount = amount+1
end
end
end
end
end

setPlayerStorageValue(cid,10010,1)
else
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid,22,"You've already killed this boss! ")
end
else
return 0
end
return 1
end


sorry for not knowing how to
Lua:
,
! :(
All credit still goes to Limos is his script i just changed for mor suiting my idea :)
 
u can test it
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') + 2000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if hasCondition(cid, CONDITION_EXHAUST) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
doCreateMonster("Giant Spider", getPlayerPosition(cid))
doRemoveItem(item.uid, 1)
doCreatureAddMana(cid, -getCreatureMaxMana(cid))
doAddCondition(cid, exhaust)
return TRUE
end

you can use it like item just put it actionid = xxx and it will work on lever..etc
 
Last edited:
It did kind of work!
however, it sends me no massage and the item disappers when i click it..
and also i want the player to just press it once!
and it would be cool if it can spawn like 6-7 sqm behind the person clicking the coffin

Edit: i fixed so the item does not disapper, by changing " doRemoveItem(item.uid, 0) " from doRemoveItem(item.uid, 1) :)

btw how do you do so you get that code window in your post? :)
 
Use [*code][/*code] tags, without *
To send msg you need to add to your script:
Code:
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You found bla bla bla.")
 
Back
Top