Page 2 of 2

Re: Chances of happening in a lua

Posted: Tue Nov 08, 2011 1:03 am
by Maveritchell
[RDH]Zerted wrote:I don't know what line Maveritchell is referring to (line 7 in you short code bit?), but you need to keep that ackaly.
Still late, still tired. Sorry for confusing the issue. I was watching the indentation and not the code.

Re: Chances of happening in a lua

Posted: Tue Nov 08, 2011 11:16 am
by Noobasaurus
Hidden/Spoiler:
[quote="[RDH]Zerted"]
[code]acklay = CreateTimer("acklay")
duration1 = math.random(200,400)
SetTimerValue(acklay, duration1)
StartTimer(acklay)

OnTimerElapse(
function(timer)
acklay5 = math.random(1,4)

if acklay5 = 2 then
--SPAWN ACKLAY! YEZ!
SetProperty("acklay", "SpawnPath", "acklay_spawn")
StartTimer("acklay1")
end
DestroyTimer(timer)
end,
acklay
)

--rnow delete the acklay path so that if it falls off a cliff it does not appear again!--
acklay1 = CreateTimer("acklay1")
SetTimerValue(acklay1, 5)
OnTimerElapse(
function(timer)
SetProperty("acklay", "SpawnPath", "")
DestroyTimer(timer)
end,
acklay1
)[/code][/quote]
Did you forget the double equals sign? I did this and I got a nice 'then' error so I added it and there was no error so I'm going to test it a bunch of times.

Re: Chances of happening in a lua [Solved]

Posted: Tue Nov 08, 2011 7:59 pm
by [RDH]Zerted
Yes, I forgot the == :oops: