How could you make a "Choose" GUI

Getting straight to the point, I am creating a story game at the moment. I am trying to get a part where you have to choose in order to continue. Like in Daycare Story 2, where you choose what team you want to play for soccer. How would you do something like this?

1 Like

make 2 buttons in a gui name one of them, for example “red” and the second one “blue”

--inside the red button make a team for red 
script.Parent.MouseButton1Down:Connect(function() 
game.Players.LocalPlayer.TeamColor = game.Teams.RedTeam.TeamColor
end)
--inside the blue one
script.Parent.MouseButton1Down:Connect(function() 
game.Players.LocalPlayer.TeamColor = game.Teams.BlueTeam.TeamColor
end)

is this what you need?

I am not trying to make teams like in Jailbreak. I wanna make it so - Ok better example. I want to make it so they can choose what type of Food they want. Like Pizza or burgers. A Gui will pop up. prompting them to choose and whatever on they choose, they get it selected into there inventory.

1 Like

Are you looking for like some kind of voting system?

1 Like

Yeah, like voting for a specific item people want. But not for everyone though

1 Like

okay then

--burger gui
--put in localscript
script.Parent.MouseButton1Down:Connect(function()
game.ReplicatedStorage.GiveBurgerEvent:FireServer(game.Players.LocalPlayer)
end)
--server script
game.ReplicatedStorage.GiveBurgerEvent.OnServerEvent:Connect(function(p,plr)

local Burger = game.ReplicatedStorage:FindFirstChild("Burger"):Clone()

Burger.Parent = plr.Backpack

end)
1 Like

Ok, yes, but how am I going to make a GUI for this to allow players to press on it and would this work for all types of Food models?

1 Like

make a gui button insert a script into it, in replicated storage make an event called “GiverBurgerEvent” then make a burger tool in replicated storage name “Burger” and do the same for every food you want to add

And I can still use the scripts that was provided by you?

yes 30characterslongaaaaaaaa30character

just change one of the variables to that specific item

--burger gui
--put in localscript
script.Parent.MouseButton1Down:Connect(function()
game.ReplicatedStorage.GiveBurgerEvent:FireServer("burger")
end)
--fries gui
--put in localscript
script.Parent.MouseButton1Down:Connect(function()
game.ReplicatedStorage.GiveBurgerEvent:FireServer("Fries")
end)

--server script
game.ReplicatedStorage.GiveBurgerEvent.OnServerEvent:Connect(function(p, item)
   if item == "burger" then
   -do thing to obtain buger
   elseif item == "Fries" then
   -same for here
   end


end)
1 Like

Add remote functions. They’re like remote events but they return data. So when they choose burger, you can just return like string or whatever and then code it in the local script

1 Like

k thank you I will test it you now

(30 Characters)

1 Like

So, I can still place a GUI inside of the code?

1 Like

wdym exactly by that?
(30 characters)

1 Like

Like, would I need to make my own code to allow the GUI to show onto the screen?

1 Like

how to attach a file?
30characters

No, I am not attaching any files. I dont understand what you mean.

1 Like

Yes, you would still need a system to show the gui onto the screen.
Some methods you could use the the .Visible boolean property, or a more commonly used and nicer looking method is :TweenPosition.

1 Like

forthisguyok.rbxl (26.0 KB)
ok there you can use that
30chars

1 Like