I'm trying to create an if-else statement in Lua script. But I can't really get it to work :( This is what I have.
First I have a randomizer that can choose between some plans
local phones_priceplan = {
{ priceplan = 'Fast'},
{ priceplan = 'Mini'},
{ priceplan = 'kort'},
}
local rnd_priceplan = math.random(1, #phones_priceplan)
local priceplan = phones_priceplan[rnd_priceplan]['priceplan']
Then if the priceplan is equal to 'Fast' I want to run another randomizer
if priceplan == "Fastpris"
local fastpris_plan = {
{ price = '145', gb = '0.5', },
{ price = '195', gb = '2', },
{ price = '245', gb = '6', },
}
local rnd_phone_surf_plan = math.random(1, #fastpris_plan)
local surf_price = fastpris_plan[rnd_phone_surf_plan]['surf_price']
end
But it is with the if statement that it seems so crash. Any ideas on what could possible be wrong :)?
'then' expected near 'local', which is quite clear.