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

Lua Script +rep

Cloow

Active Member
Joined
May 10, 2010
Messages
1,086
Reaction score
35
Code:
-- Script by: Cloow
-- Using QtluaPad
function onStepIn(cid, item, position, fromPosition)
   if item.actionid == 18851 and getPlayerStorageValue(cid, 188511) > 0 then
     return NOTHING? - Here, I want it to be nothing. What should it be?
    end
    
    doPlayerSendTextMessage(cid, 21, "This boat is kinda creepy, it seems there was someone who have taken it from the humans?")
    return TRUE 
end

Alright, so this part "return NOTHING? - Here, I want it to be nothing. What should it be?"

I want it to work like this, when u walked on that tile. Then trying to walk on it again, you wont get the textmessage again, I just want nothing to heppend actually.

:ninja:
 
Ahh, icic. It was this line
then?


Code:
-- Created using QtLuaPad
-- Written by: Cloow
local t = 
{pos = {x=5199, y=4764, z=7},
monster = "Demon"
}

 function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 and getPlayerStorageValue(cid, 188522) > 0 then
return true 
end
if getPlayerStorageValue(cid,188522) <= 0 then
doCreateMonster(t.monster, t.pos)
doPlayerSendTextMessage(cid, 21, "Are you trying to steal my treasure?!")
return TRUE
end


Error
[28/12/2010 02:04:47] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/questboat.lua:16: 'end' expected (to close 'function' at line 8) near '<eof>'
[28/12/2010 02:04:47] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/questboatt.lua)
[28/12/2010 02:04:47] data/actions/scripts/quests/questboat.lua:16: 'end' expected (to close 'function' at line 8) near '<eof>'
[28/12/2010 02:04:48] [Warning - Actions::registerEvent] Duplicate registered item id: 5791
 
Code:
-- Created using QtLuaPad
-- Written by: Cloow
local t = {
pos = {x=EDIT, y=EDIT, z=EDIT}
monster = {"Demon"}

function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 then
doCreateMonster(t.monster, t.pos)
return TRUE
end

This
 
LUA:
-- Created using QtLuaPad
-- Written by: Cloow
local t =  {
pos = {x=5199, y=4764, z=7},
monster = "Demon"
}

 function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 and getPlayerStorageValue(cid, 188522) > 0 then
return true 
end
if getPlayerStorageValue(cid,188522) <= 0 then
doCreateMonster(t.monster, t.pos)
doPlayerSendTextMessage(cid, 21, "Are you trying to steal my treasure?!")
end
return TRUE
end

Btw you're not setting storage to 1 or anything, so if u step again it'll be the same you must add:
setPlayerStorageValue(cid,188522,1)
after doPlayerSendText...

Easier version:
LUA:
-- Created using QtLuaPad
-- Written by: Cloow
local t =  {
pos = {x=5199, y=4764, z=7},
monster = "Demon"
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,188522) < 1 then
   doCreateMonster(t.monster, t.pos)
   doPlayerSendTextMessage(cid,21, "Are you trying to steal my treasure?!")
   setPlayerStorageValue(cid,188522,1)
end
return true
end
 
Last edited:
LUA:
-- Created using QtLuaPad
-- Written by: Cloow
local t =  {
pos = {x=5199, y=4764, z=7},
monster = "Demon"
}

 function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 and getPlayerStorageValue(cid, 188522) > 0 then
return true 
end
if getPlayerStorageValue(cid,188522) <= 0 then
doCreateMonster(t.monster, t.pos)
doPlayerSendTextMessage(cid, 21, "Are you trying to steal my treasure?!")
end
return TRUE
end

Yeah, now i don't get any errors :)

What did u change?
 
Back
Top