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

Puzzling thing

Mera Mero

Guess Who?
Joined
Dec 27, 2014
Messages
417
Reaction score
86
I need to make a Stone (it can be other thing, but stone is for example) what is required to kill. Every 10% hp (it can be just amount of hp) lose, it will spawn wave of monsters. Every wave will be stronger that previous. After kill the Stone, teleport will appear. i already saw it before on ot
Thanks
Yo @Limos
 
Last edited:
@Mera Mero Thank you!

Ok guys, as we can all see, the server version she is using is right in front of us. She doesn't have any errors loading the script, and we are still without clues as to why it isn't working for her... Can we get someone else who uses this server to try the script please?

I've tested in on TFS 0.3.7 and there were no issues:

vLWtfOd.gif
 
Last edited:
I KNOW WHAT THE PROBLEM IS!?!?! MUAHAHAHAHAHAHAHAHAHAHAHAHA

For some stupid damn reason, your doCreateMonster does not have 4 parameters.
//doCreateMonster(name, pos[, extend = false[, force = false]]) <<----- This is the normal doCreateMonster parameters,

but yours has something more like

//doCreateMonster(name, pos)

or

//doCreateMonster(name, pos[, extend = false])


SO to fix this script, (for you) just remove the last 2 parameters on ANY of the scripts (other than santy's) on this entire thread.

Code:
local damagePercent = {
  {"Troll","Monk"}, -- this happens at 90% health
  {"rat","rift scythe"}, -- this happens at 80% health
  {"rift scythe","rift scythe"}, -- this happens at 70% health
  {"rift scythe","rift scythe"}, -- this happens at 60% health
  {"rift scythe","rift scythe"}, -- this happens at 50% health
  {"rift scythe","rift scythe"}, -- this happens at 40% health
  {"rift scythe","rift scythe"}, -- this happens at 30% health
  {"rift scythe","rift scythe"}, -- this happens at 20% health
  {"rift scythe","rift scythe"}, -- this happens at 10% health
}

function onThink(cid, interval)
  if isCreature(cid) then
  local current = getPlayerStorageValue(cid, "current")
  if current == -1 then current = 1 end
  if current <= #damagePercent then
  local SummonsList = damagePercent[current]
  if getCreatureHealth(cid) <= (getCreatureMaxHealth(cid) - ((getCreatureMaxHealth(cid)/10)*current)) then
  for _, tid in ipairs(SummonsList) do
--FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED--
  doCreateMonster(tid, getCreaturePosition(cid)) ------------------------Fixed--
--FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED--
  end
  doPlayerSetStorageValue(cid, "current", current+1)
  end
  end
  end
  return true
end
 
I've tested in on TFS 0.3.7 and there were no issues:

vLWtfOd.gif
thanks but didn't work with me o_O tfs 0.3.6 weird
Tested on my version of TFS.

Here is full video for proof.

you got same problem as me but i don't know how did this rat created LOL! and other monsters didn't :)
I KNOW WHAT THE PROBLEM IS!?!?! MUAHAHAHAHAHAHAHAHAHAHAHAHA

For some stupid damn reason, your doCreateMonster does not have 4 parameters.
//doCreateMonster(name, pos[, extend = false[, force = false]]) <<----- This is the normal doCreateMonster parameters,

but yours has something more like

//doCreateMonster(name, pos)

or

//doCreateMonster(name, pos[, extend = false])


SO to fix this script, (for you) just remove the last 2 parameters on ANY of the scripts (other than santy's) on this entire thread.

Code:
local damagePercent = {
  {"Troll","Monk"}, -- this happens at 90% health
  {"rat","rift scythe"}, -- this happens at 80% health
  {"rift scythe","rift scythe"}, -- this happens at 70% health
  {"rift scythe","rift scythe"}, -- this happens at 60% health
  {"rift scythe","rift scythe"}, -- this happens at 50% health
  {"rift scythe","rift scythe"}, -- this happens at 40% health
  {"rift scythe","rift scythe"}, -- this happens at 30% health
  {"rift scythe","rift scythe"}, -- this happens at 20% health
  {"rift scythe","rift scythe"}, -- this happens at 10% health
}

function onThink(cid, interval)
  if isCreature(cid) then
  local current = getPlayerStorageValue(cid, "current")
  if current == -1 then current = 1 end
  if current <= #damagePercent then
  local SummonsList = damagePercent[current]
  if getCreatureHealth(cid) <= (getCreatureMaxHealth(cid) - ((getCreatureMaxHealth(cid)/10)*current)) then
  for _, tid in ipairs(SummonsList) do
--FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED--
  doCreateMonster(tid, getCreaturePosition(cid)) ------------------------Fixed--
--FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED----FIXED--
  end
  doPlayerSetStorageValue(cid, "current", current+1)
  end
  end
  end
  return true
end
OMG FINALLY MADE IT!!! it's working very good now :p thanks!!!! did you see that it's wasn't my fault :D

Hello, Flatlander brought me here.

Your problem is 0.3.6

Have a nice day!
Welcome to the only one who made me crazy with his scripts :p btw i'm big fan of your projects like otmadness 8.1/8.60 //deathzot!!! This is an honor to me that you are here
LOL, nice to see you alive
isn't your avatar is Kim kardashian's husband? :p (THE BITCH)
@Mera Mero Thank you!

Ok guys, as we can all see, the server version she is using is right in front of us. She doesn't have any errors loading the script, and we are still without clues as to why it isn't working for her... Can we get someone else who uses this server to try the script please
mmm did you see this? this wasn't my fault :p and i don't need to forget to Thank everyone who helped me with this script THANKS ALL
 
LMAO!!!!!!!!!!!!!!!!!

Go flatlander!

Question, did her posting her server console screenshot (showing the server version) help you to solve it?

No, I should have known on page 2.

I was re-reading the thread, and at first, they made the function with doSummonMonster(cid, name)

But she then changed doSummonMonster(cid, name) to doCreateMonster(cid, name) and received an error similar to "No creature with name '348392415'"
This means, it was trying to use the cid as a name. (which means it was working)

But then later on, all of the errors showed "No monster with name ' ' " meaning it wasn't getting any name.
And we were using doCreateMonster(name, pos, false, true)

Since functions pull from the last parameter first, it was trying to use the last 2 parameters. which were true and false.
 
O.O

Really??!?!?!? Wow! Didn't know that, learn something new everyday...

Well, in the source it does, LUA functions go in order.

SO for example.
If I made the function in 050-functions.lua in the lib folder.
Code:
function doThreeThings(cid, target, item)
then had somewhere that I put doThreeThings(cid, target, item, itemEx, magiceffect)
It would only pull the first 3, and ignore the last 2.

But if you made the same function in luafunctions.cpp
It would pull the last 3 instead of the first 3. (at least that is how everything is scripted to my knowledge in 0.3.6)
 
Code:
local spawns = {
{"Troll","Monk"}, -- this happens at 90% health
{"rat","rift scythe"}, -- this happens at 80% health
{"rift scythe","rift scythe"}, -- this happens at 70% health
{"rift scythe","rift scythe"}, -- this happens at 60% health
{"rift scythe","rift scythe"}, -- this happens at 50% health
{"rift scythe","rift scythe"}, -- this happens at 40% health
{"rift scythe","rift scythe"}, -- this happens at 30% health
{"rift scythe","rift scythe"}, -- this happens at 20% health
{"rift scythe","rift scythe"} -- this happens at 10% health
}

local spawnid = {}

function onThink(cid, interval)
if isCreature(cid) then
if(!spawnid[cid]) spawnid[cid] = 11
current = math.floor(getCreatureMaxHealth(cid)/getCreatureHealth(cid))
if spawnid[cid] != current and current <= #spawns then
spawnid[cid] = current
print(spawnid[cid])
for _, tid in ipairs(spawns[cid]) do
doCreateMonster(tid, getCreaturePosition(cid))
end
end
else
spawnid[cid] = 0
end
return true
end

Fixed, much better than FlatLanders. Just had to remove the semicolons at linebreaks, this should probably work more efficiently if you test it.
 
Code:
local spawns = {
{"Troll","Monk"}, -- this happens at 90% health
{"rat","rift scythe"}, -- this happens at 80% health
{"rift scythe","rift scythe"}, -- this happens at 70% health
{"rift scythe","rift scythe"}, -- this happens at 60% health
{"rift scythe","rift scythe"}, -- this happens at 50% health
{"rift scythe","rift scythe"}, -- this happens at 40% health
{"rift scythe","rift scythe"}, -- this happens at 30% health
{"rift scythe","rift scythe"}, -- this happens at 20% health
{"rift scythe","rift scythe"} -- this happens at 10% health
}

local spawnid = {}

function onThink(cid, interval)
if isCreature(cid) then
if(!spawnid[cid]) spawnid[cid] = 11
current = math.floor(getCreatureMaxHealth(cid)/getCreatureHealth(cid))
if spawnid[cid] != current and current <= #spawns then
spawnid[cid] = current
print(spawnid[cid])
for _, tid in ipairs(spawns[cid]) do
doCreateMonster(tid, getCreaturePosition(cid))
end
end
else
spawnid[cid] = 0
end
return true
end

Fixed, much better than FlatLanders. Just had to remove the semicolons at linebreaks, this should probably work more efficiently if you test it.
hmm thanks but i already got script of flatlander :) and its working fine :p
 
Kk you could also make the code more efficient with real statistical %

(untested)
for _,prc in ipairs({100,90,80...}) do
e=(maxHealth*prc) / 100
if health<=e then
spawn()
end
end
 
@Santy the not equal to operator in Lua is ~= not !=.
!(expression) should be; not (expression). If-statements has to be closed even if the block is on the same line.

Code:
if(!spawnid[cid]) spawnid[cid] = 11
if (not spawnid[cid]) then spawnid[cid] = 11 end
Code:
if spawnid[cid] != current and current <= #spawns then
if spawnid[cid] ~= current and current <= #spawns then

On this line spawns[cid] will be nil. It should be indexing one of the spawn fields, meaning instead of cid it should be a number between 1 and 9.
Code:
for _, tid in ipairs(spawns[cid]) do

Nothing wrong with Flatlander's script.
 
Thanks for the LUA rules refresh, but my script is actually more efficient if you fix the different syntax errors. I'll leave it to you to figure why mine uses cid. *ehm* spawns[spawnid[cid]] *ehm*
 
Back
Top