here's a very simple tutorial on how to make UIs actually function

"how do I check if a button has been clicked?"

it's very simple

  1. create a ScreenGui in StarterGui
  2. create a TextButton in the newly-made ScreenGui
  3. add a script in the button, preferably a LocalScript

here's an example on how to make buttons scripted:

script.Parent.MouseButton1Click:connect(function()
    print("I was clicked")
end)

or, if you like splitting them up

function action()
    print("I was clicked")
end

script.Parent.MouseButton1Click:connect(action)

here's an example on a simple form thingy

this is how you should set up your StarterGui

StarterGui

  • ScreenGui

in screengui, place these in

  • submit (TextButton)

  • box (TextBox)

  • typed (TextLabel)

  • handler (LocalScript)

in the handler script, try this

local submit = script.Parent.submit
local box = script.Parent.box
local typed = script.Parent.typed

function handle() 
if (box.Text == "" or box.Text == nil) then
    print("nothing typed in TextBox")
    typed.Text = "Nothing typed!"
    return
end

    -- now, make whatever the user typed
    typed.Text = box.Text -- box.text is whatever the user typed in
    print("user typed " .. box.Text)
end

submit.MouseButton1Click:connect(handle)

hope this helps

and if there are any errors, feel free to PM me and I'll fix it

3
3
0