So I’ve been having some trouble trying to fix this bug for quite a while.
The first time I click the right button, it gets it right and continues forward. The 2nd time I click the correct button and it fails me. I also noticed that it took one of randomorder = 2's
dialog on randomorder = 1
. I’ve tried doing:
if burger == true then
berger.MouseButton1Click:Connect(function()
order.Text = "correct"
nexto = false
wait(2)
gui:Destroy()
end)
end
But made things a bit worse. I don’t know how to explain it more, here’s the function I wrote:
function neworder ()
local randomorder = math.random(1,2)
if randomorder == 1 then
print("1")
c.Text = "bru boya"
order.Text = "give pineapple pizza or noob >:("
berger.MouseButton1Click:Connect(function()
order.Text = "wrong order not cool"
nexto = false
wait(2)
gui:Destroy()
end)
fry.MouseButton1Click:Connect(function()
order.Text = "i dont want frie >:(((((("
nexto = false
wait(2)
gui:Destroy()
end)
pizzer.MouseButton1Click:Connect(function()
order.Text = "thanks :>))>)"
credits.Value = credits.Value + Pay
money = money + Pay
print("Paid "..Pay.." Credits")
wait(.5)
nexto = true
end)
holywater.MouseButton1Click:Connect(function()
order.Text = "no"
nexto = false
wait(2)
gui:Destroy()
end)
elseif randomorder == 2 then
print("2")
c.Text = "andrea"
order.Text = "give berger"
berger.MouseButton1Click:Connect(function()
order.Text = "cool thnaks"
credits.Value = credits.Value + Pay
money = money + Pay
print("Paid "..Pay.." Credits")
wait(.5)
nexto = true
end)
fry.MouseButton1Click:Connect(function()
order.Text = "that nto a berger"
nexto = false
wait(2)
gui:Destroy()
end)
pizzer.MouseButton1Click:Connect(function()
order.Text = "thanks alot loser"
wait(.5)
gui:Destroy()
end)
holywater.MouseButton1Click:Connect(function()
order.Text = "h"
nexto = false
wait(2)
gui:Destroy()
end)
end
end
Is there a possible solution to this? Thanks, I appreciate any help given to me.