• 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:
 
just return true at that part and the script will be stopped at that point so the textmessage won't be sent since it is after that point.
 
So like this ?

-- Script by: Cloow
-- Using QtluaPad
function onStepIn(cid, item, position, fromPosition)
if item.actionid == 18851 and getPlayerStorageValue(cid, 188511) > 0 then
return true

doPlayerSendTextMessage(cid, 21, "This boat is kinda creepy, it seems there was someone who have taken it from the humans?")
return TRUE
end

Or maybe like this

Code:
-- Script by: Cloow
-- Using QtluaPad
function onStepIn(cid, item, position, fromPosition)
   if item.actionid == 18851 and getPlayerStorageValue(cid, 188511) > 0 then
     return true elseif getPlayerStorageValue(cid, 188511) > 1 then 
    doPlayerSendTextMessage(cid, 21, "This boat is kinda creepy, it seems there was someone who have taken it from the humans?")
    return TRUE 
end
 
Yeh, return true:
LUA:
-- Script by: Cloow
-- Using QtluaPad
function onStepIn(cid, item, position, fromPosition)
if item.actionid == 18851 and getPlayerStorageValue(cid, 188511) > 0 then
return true
end
if getPlayerStorageValue(cid,188511) <= 0 then
   doPlayerSendTextMessage(cid, 21, "This boat is kinda creepy, it seems there was someone who have taken it from the humans?")
end
return TRUE
end

Or just do it in a different way:
LUA:
function onStepIn(cid, item, position, fromPosition)
if getPlayerStorageValue(cid,188511) < 0 then
   doPlayerSendTextMessage(cid, 21, "This boat is kinda creepy, it seems there was someone who have taken it from the humans?")
   setPlayerStorageValue(cid,188511,1)
end
return true
end
 
Thanks for the help guys ;> rep for u baoth ;>

Ohh, damn santiggg.

You must spread some Reputation around before giving it to santigggg again.

I'll rep u another time alright? :)
 
LUA:
-- Script by: Cloow
-- Using QtluaPad
function onStepIn(cid, item, position, fromPosition)
   if item.actionid == 18851 and getPlayerStorageValue(cid, 188511) > 0 then
     doPlayerSendCancel(cid, "You'r cancel text comes over here <- there yea you see it?")
    end
    
    doPlayerSendTextMessage(cid, 21, "This boat is kinda creepy, it seems there was someone who have taken it from the humans?")
    return TRUE 
end

As i understond you want that? test it if its it :D
 
LUA:
-- Script by: Cloow
-- Using QtluaPad
function onStepIn(cid, item, position, fromPosition)
   if item.actionid == 18851 and getPlayerStorageValue(cid, 188511) > 0 then
     doPlayerSendCancel(cid, "You'r cancel text comes over here <- there yea you see it?")
    end
    
    doPlayerSendTextMessage(cid, 21, "This boat is kinda creepy, it seems there was someone who have taken it from the humans?")
    return TRUE 
end

As i understond you want that? test it if its it :D

He wanted that, but that instead of this
LUA:
doPlayerSendCancel(cid, "You'r cancel text comes over here <- there yea you see it?")
It did nothing :p
 
Here is a little problem again hehe >.<

-- Created using QtLuaPad
-- Written by: Cloow
local t = (
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 then
doCreateMonster("Demon", t.pos)
return TRUE
end

Now, i forgot how to write "local t"
I think it was like

local t = (
x = 1512,
y = 5122,
z = 6
)

right ?

And for creatures it's

local m = (
"Demon"
)

?
 
LUA:
-- Created using QtLuaPad
-- Written by: Cloow
local t = {
pos = {x=EDIT, y=EDIT, z=EDIT}
}
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 then
doCreateMonster("Demon", t.pos)
return TRUE
end
 
LUA:
-- 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

No need to use 'm' instead of 't', they're just locals
 
LUA:
-- 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

No need to use 'm' instead of 't', they're just locals

Damn im startin to understand that shit

ok so mine would be like

LUA:
-- Created using QtLuaPad
-- Written by: Cloow
local m = {
monster = "Demon"
}
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 then
doCreateMonster(m.monster, )
return TRUE
end

if im right?
 
Damn im startin to understand that shit

ok so mine would be like

LUA:
-- Created using QtLuaPad
-- Written by: Cloow
local m = {
monster = "Demon"
}
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 18852 then
doCreateMonster(m.monster, )
return TRUE
end

if im right?

you're missing the spawn locations, you need to set where you want the monster to spawn or it'll not run the script :)
 
[Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/questboat.lua:7: '}' expected (to close '{' at line 4) near 'monster'
[28/12/2010 01:56:27] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/questboat.lua)
[28/12/2010 01:56:27] data/actions/scripts/quests/questboat.lua:7: '}' expected (to close '{' at line 4) near 'monster'

This was wierd, i get this error. I've checked line 3 nothing special there.
 
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

try that?
 
@Up: Nope, my mistake sorryy
This should work:
LUA:
-- 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
 
Back
Top