Click detector, choose quantity?

Hi, I was planning on starting a group… I was wondering if there is a way that someone could be able to click on a gear, and have it send a GUI to the user that says how many of the item do they want?

Is this a thing?

Added: I was thinking of the group being about desserts specifically.
Example: Person clicks on gear “gets a GUI that says how many of the product they want… (how many slices)”

I guess (pretty sure) you are a beginner at scripting. I don’t actually understand if by the group you mean a place owned by the group or the group page, but I will also guess that it’s a place.

You should at least read a few examples given on the DevHub.

Do you know what it would be called?

That would be the basics of what you need to make a GUI to show up, for the rest it’s just logic and some variables.

You need a frame to contain everything, a TextBox for the quantity and a TextButton or an ImageButton to confirm the request. Every button has a .MouseButton1Click event which you can listen to and call a function which would do everything.

These would be the basics:

local guiFrame = script.Parent
local guiQuantity = guiFrame.Quantity
local guiConfirm = guiFrame.Confirm

guiConfirm.MouseButton1Click:Connect(function()
    --get the selected quantity
    local valQuantity = tonumber(guiQuantity.Text)
    if not valQuantity then
        --check if the selected quantity is a valid number and return if it isn't
        guiQuantity.Text = "Invalid input"
        return
    end
    --stuff here
end)

Ok, thank you so much! I will look further into it. :slight_smile:

1 Like