View Full Version : Counting Monsters
Seligeari
12-17-2015, 10:44 AM
Hello.
I wrote some condition instruction but its not working. My question is why? :o
local kongra = Self.GetCreatureKills(Kongra)
local ape = Self.GetCreatureKills(Sibang)
local merlkin = Self.GetCreatureKills(Merlkin)
local all = math.max(kongra + ape + merlkin)
if counttask >= 3 then
Walker.GoTo("GoToHunt")
end
if all >= 300 then
Self.ResetCreatureKills(Kongra)
Self.ResetCreatureKills(Sibang)
Self.ResetCreatureKills(Merlkin)
Walker.GoTo("Task")
end
if all <= 300 then
Walker.Goto("GoToHunt")
end
counttask is set for 0 and it adds 1 everytime when hes at grizzly.
fioletowya
12-17-2015, 03:42 PM
Hello.
I wrote some condition instruction but its not working. My question is why? :o
local kongra = Self.GetCreatureKills(Kongra)
local ape = Self.GetCreatureKills(Sibang)
local merlkin = Self.GetCreatureKills(Merlkin)
local all = math.max(kongra + ape + merlkin)
if counttask >= 3 then
Walker.GoTo("GoToHunt")
end
if all >= 300 then
Self.ResetCreatureKills(Kongra)
Self.ResetCreatureKills(Sibang)
Self.ResetCreatureKills(Merlkin)
Walker.GoTo("Task")
end
if all <= 300 then
Walker.Goto("GoToHunt")
end
counttask is set for 0 and it adds 1 everytime when hes at grizzly.
Self.GetCreatureKills(Kongra) -> Self.GetCreatureKills("Kongra")
Seligeari
12-17-2015, 04:53 PM
I understand your post as replace old one with new ones am i right? :)
XtrmJosh
12-17-2015, 06:49 PM
I understand your post as replace old one with new ones am i right? :)
Kongra, Sibang, and Merlkin are not variables and will be unrecognised by the scripting engine. You need to declare string type variables according to the conventions of the language which you are using. In this case, they need to be wrapped in quotes.
Observe the difference between:
myVariable = Some Creature Name
and
myVariable = "Some Creature Name"
Running the former, if you explore how the scripting engines work, you will likely notice that it fails trying to assign the value of the variable Some to the variable myVariable, It will not recognise Some as a variable, and as such will complain accordingly. If, by pure coincidence, Some was a valid variable, it would then look for Creature. If both Creature and Name happened to be recognised as variables, then myVariable would eventually be assigned the value of the variable Name. This is not what you want to do.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.