About this script: If someone touches this part then a GUI will pop up(visible = true), but in this case in doesn't pop up. Can anyone please help? Thanks!
1 | workspace.mayorTrigger.Touched:connect( function () |
2 | print ( "touched" ) |
3 | script.Parent.Parent.Parent.StarterGui.buttonInteract.buttonFrameMayor.Visible = true |
4 | end ) |
The script for onTouched shouldn't be in a LocalScript. Instead you should put a script in a part and make the line something such as :
1 | script.Parent.Touched:connect( function (Hit) |
2 | local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) |
3 | if Player then |
4 | Player.PlayerGui.buttonInteract.buttonFrameMayor.Visislbe = true |
5 | end |
6 | end ) |