Jump to content
Sign in to follow this  
SimplifiedCode

Basic UI Scripting Tutorial

Recommended Posts

Hello! I'm SimplifiedCode! back at it again with another tutorial. Today we will be doing basic UI scripting with Filtering Enabled! Let's get started!

First, let's make a basic UI in StarterGui:

1.PNG.467677b3df6925c589851a324da6c8ff.PNG

We put our GUI's in StarterGui because we want the player to get it every time they join!

Now inside the Button, let's make a "Local script":

2.PNG.d81eb94c74a96bf9958fbf5885fcefd8.PNG

In this script, write:

script.Parent.MouseButton1Click:connect(function()

script.Parent.Parent.Visible = false

end)

This tells the button that whenever someone clicks on it, it goes away.

What happens if we reset? We get it again! That is because every time you die, your Guis refresh. That's why you reset when something is broken in a game. To fix this, we can do:

script.Parent.MouseButton1Click:connect(function()

script.Parent.Parent.Parent.ResetOnSpawn = false

script.Parent.Parent.Visible = false

end)

This tells the Gui to not reset on spawn or when you rest, and it disables when you click on it.

That concludes this basic tutorial, sorry for being so short, I'll edit this if you have any ideas that you have to add to this. Thanks!

You can get the Gui and scripts from this tutorial here

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.