What do you want to achieve? Keep it simple and clear!
I made a gui and I want to connect a function to the MouseButton1Click event from a TextButton
What is the issue? Include screenshots / videos if possible!
It simply don’t click! and it don’t connect… When I put the mouse above the button, it don’t turn lightish.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I think the button click it self for some reason so I made a check but it didn’t work so I removed it
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
You may want to also add 2 separate events for the team change, one for cops, the other for prisoners. This will make sure the player gets the exact team they need because passing a string through a remote event to change a team is not a good idea.
MenuGui is the PlayerGui itself. I just noticed an issue on your code that you are trying to wait for a click on a button that is not displayed on the screen, since the button is parented on PlayerGui not a ScreenGui. Delete this line on your code:
MenuGui.Button1.MouseButton1Click:Wait() --Waits Until click