#Egg hatching not working?
25 messages · Page 1 of 1 (latest)
you can see the error with the words underlined in red
yeah but it's not explaining it well enough for me to understand
Players.zg13t.PlayerGui.ScreenGui.Frame.TextButton.Script:6: Expected 'then' when parsing if statement, got '='
like in python assignment (=) and comparison (==)
oh is that the same in lua
ah, thank you
hmm?
local pet = "blabla"
if pet == 1 or 2 then
-- always true
print("mh")
else
print("nop")
end
your condition is (condition_1) or (condition_2)
with condition_1 -> (pet == 1)
and condition_2 -> (2)
but 2 is always true
and to finish, hash ~= Hash
it's case sensitive
Hatch is underline because not define
also @ember vapor at the end there see how Hatch is underlinded blue it means that the script sees it as undefinded
so change it to hatch
k
instead of Hatch
local coins = 500
function hatch()
if coins > 499 then
local pet = math.random(1,6)
if pet == 1 or pet == 2 or pet == 3 then
print("common")
end
if pet == 4 or pet == 5 then
print("rare")
end
if pet == 6 then
print("legendary")
end
end
end