game.Players.PlayerAdded:Connect(function(plr)
local sd = math.random()
if sd = 0 then
print("NotHaoBorn")
if sd = 1 then
print("HaoBorn")
end
end
end))`
COMMUNITY QUESTION
Expected 'then' when parsing if statement, got '=' help me?
2 answers
When writing if statements, you're required to have two '=' signs.
So, all you need to do is
game.Players.PlayerAdded:Connect(function()
local sd = math.random()
if sd == 0 then
print("NotHaoBorn")
if sd == 1 then
print("sd is 1")
end
end
end)
Let me know if you have any questions.
In an if statement, putting "==" will check if sd is 0. if you put "~=", it will check if sd is not 0. If you just put an equals sign, it will not work.
This discussion is preserved as it was. New answers, comments, and votes are closed.
