Gahdzilla
|
  |
| Joined: 09 Jun 2016 |
| Total Posts: 351 |
|
|
| 01 Oct 2016 05:46 PM |
Ok so I put this script into a brick. I want to be able to open a Gui when somebody clicks a brick. Please let me know how to fix this.
This is what i have.
local tipgui1 = game.Player.LocalPlayer.PlayerGui.TipGui
function onClicked() if script.Parent.Anchored == true then tipgui1.TipFrame.Visible = true
end end script.Parent.MouseButton1Down:connect(onClicked)
I'm still learning and the help would be much appreciated please let me know what i did wrong as well.
|
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 05:55 PM |
You use MouseClick and a ClickDetector on a part to detect someone clicking it, which returns the player who clicked it so there's no need to use a local script:
script.Parent.ClickDetector.MouseClick:connect(function(plyr) local gui = plyr.PlayerGui.TipGui gui.TipFrame.Visible = true end) |
|
|
| Report Abuse |
|
|
Gahdzilla
|
  |
| Joined: 09 Jun 2016 |
| Total Posts: 351 |
|
| |
|