Chances of happening in a lua [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Chances of happening in a lua

Post 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.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Chances of happening in a lua

Post 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.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Chances of happening in a lua [Solved]

Post by [RDH]Zerted »

Yes, I forgot the == :oops:
Post Reply