tech/game

21/07/21 How to make a Login Menu in Roblox Studio

tech-lover 2021. 7. 21. 16:40

https://youtu.be/4YXfaNFpKRw

- open main menu botton script

```

local LoginFrame = script.Parent.Parent.LoginFrame

 

script.Parent.MouseButton1Click:Connect(function()

    if LoginFrame.Visible == true then

        LoginFrame.Visible = false

    else

        LoginFrame.Visible = true

    end

end)

```

 

- StaffMenu>LoginButton>LocalScript

 

```

local Username = script.Parent.Parent.UsernameBox

local Password = script.Parent.Parent.PasswordBox

local MainFrame = script.Parent.Parent.Parent.MainFrame

 

script.Parent.MouseButton1Click:Connect(function()

    if Username.Text == "aa" and Password.Text == "bb" then

        script.Parent.Text = "Correct!"

        wait(0.2)

        script.Parent.Text = "Login"

        MainFrame.Visible = true

    else

        script.Parent.Text = "Wrong. Now will Be Destroyed."

        wait(0.5)

        script.Parent.Parent.Parent.Parent.StaffMenu:Destroy()

    end

end

)

```

 

References

Roblox Studio How To Make A Working Main Menu

https://youtu.be/mvnmkc7xmcQ

 

 

 

- play script

```

script.Parent.MouseButton1Click:Connect(function()

   script.Parent.Parent.Visible = false

end)

```

 

- Settings script

```

script.Parent.MouseButton1Click:Connect(function()

script.Parent.Parent.SettingFrame.Visible = true

end)

```

 

- Close script

```

script.Parent.MouseButton1Click:Connect(function()

script.Parent.Parent.Visible = false

end)

```