Hi everyone,
I have been working on a game and I have had this problem for a while now. The surface Gui doesn’t change to what the Server Script in the model says.
The text in the Surface Gui needs to change to the Combination that is chosen by the script. That does seem to work but when I try to set the text to the text created by the script it just does do anything. The code also doesn’t give any errors. I don’t know what is wrong because I am relatively new
This is my code:
-- Objects
local BottomBurger = script.Parent.BottomBurger
local TopBurger = game.ReplicatedStorage.BurgerStuff.TopBurger
local ScreenText = script.Parent.Screen.SurfaceGui.Frame.Ingredients.Text
-- Combinations
local Combinations = {
{"Salade", "Salade", "Union"},
{"Salade", "Salade", "Tomato"},
{"Salade", "Salade", "Cheese"},
{"Salade", "Union", "Union"},
{"Salade", "Union", "Tomato"},
{"Salade", "Union", "Cheese"},
{"Salade", "Tomato", "Tomato"},
{"Salade", "Tomato", "Cheese"},
{"Salade", "Tomato", "Union"},
{"Salade", "Cheese", "Cheese"},
{"Salade", "Cheese", "Union"},
{"Salade", "Cheese", "Tomato"},
{"Union", "Union", "Salade"},
{"Union", "Union", "Tomato"},
{"Union", "Union", "Cheese"},
{"Union", "Salade", "Tomato"},
{"Union", "Salade", "Cheese"},
{"Union", "Tomato", "Tomato"},
{"Union", "Tomato", "Cheese"},
{"Union", "Cheese", "Cheese"},
{"Tomato", "Tomato", "Salade"},
{"Tomato", "Tomato", "Union"},
{"Tomato", "Tomato", "Cheese"},
{"Cheese", "Cheese", "Salade"},
{"Cheese", "Cheese", "Union"}
}
function GenerateBurger()
local Combination = math.random(1, #Combinations)
local ChoosenCombination = Combinations[Combination]
local Ingredient_1 = ChoosenCombination[1]
local Ingredient_2 = ChoosenCombination[2]
local Ingredient_3 = ChoosenCombination[3]
print(ChoosenCombination)
local Text = ("I would like a burger with: " .. Ingredient_1 .. ", " .. Ingredient_2 .. ", " .. Ingredient_3 .. ".")
ScreenText = Text
end
GenerateBurger()
The model: