So I'm just wondering how I would create a tool, lets say a Pizza and when you click on the Pizza it brings up a GUI, this GUI will have a selection of different flavours, lets say Peperoni, Meat Lovers and the Works.
My ONLY problem is, I'm not sure how I'd do that, I want it so that when you click the selection that you want, the Pizza will go into your inventory.
Now I do know that I'm going to add the Tools into the lighting, because I'm pretty sure in order for this script to work the tools will have to go under the lighting?
Also, once the player has clicked the selection of the Pizza He/She wants the GUI will be destroyed, I'm not sure if I'm suppose to use Destroy() or..? And with the GUI, would that go under StarterGUI or lighting?
-iiKeegs
Are you asking when the player clicks WITH the tool or clicks the tool directly? In either case, this will not be to much of a problem. But, just a heads up, scripts will not be able to run if they are in the lighting or a descendant of lighting in any way. If you are using lighting to store items then don't. Use ReplicatedStorage now instead.
Put this in a local script inside the tool you want to use:
Tool=script.Parent player=game.Players.LocalPlayer function onEquippedLocal(mouse) mouse.MouseButton1Down:connect(function() player.PlayerGui["ScreenGui you want"]["Item you want (usually a frame)"].Visible=true end) end Tool.Equipped:connect(onEquippedLocal)
This will make a specific GUI appear when the player clicks with a tool.
If you want the tool to be clicked directly like if the player is clicking on a brick, you can use this:
player=game.Players.LocalPlayer mouse=player:GetMouse() mouse.MouseButton1Down:connect(function() if mouse.Target then if mouse.Target.Name=="Name of the part you chose" then player.PlayerGui["ScreenGui you want"]["Item you want (usually a frame)"].Visible=true end end end)
Put this inside the player or the starterpack or whatever. Just make sure it is in a local script.