Saodo
|
  |
| Joined: 26 Jul 2011 |
| Total Posts: 1206 |
|
|
| 26 Oct 2013 08:00 AM |
The GUI is not showing up when the door is touched. This is in a local script.
plyr = game.Players.LocalPlayer GUI = plyr.PlayerGui.ScreenGui.Frame
script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then GUI.Visible = true end end)
|
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 26 Oct 2013 08:18 AM |
script.Parent.Touched
If you are using a LocalScript correctly, this should be in the playergui, and the playerGui can't be touched.
http://www.roblox.com/My/Groups.aspx?gid=890640 |
|
|
| Report Abuse |
|
|
Saodo
|
  |
| Joined: 26 Jul 2011 |
| Total Posts: 1206 |
|
|
| 26 Oct 2013 08:52 AM |
| This script is inside a brick |
|
|
| Report Abuse |
|
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 26 Oct 2013 08:56 AM |
A brick is Server side (Or it must be in a Instance of Client (Camera, Backpack, PlayerGui). Since Backpack and PlayerGui can't hold bricks, your only option will be the camera))
You are targeting this brick as Client, during the fact that you are using LocalPlayer (LocalScript). A LocalScript can't detect that kind of stuff.
So what you can do is just create a function that will do the same action when the Player has touched the brick, in a Script (Not a LocalScript)
~ Velibor
|
|
|
| Report Abuse |
|
|
Saodo
|
  |
| Joined: 26 Jul 2011 |
| Total Posts: 1206 |
|
|
| 26 Oct 2013 08:58 AM |
| so you are saying just put it in a normal script? |
|
|
| Report Abuse |
|
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 26 Oct 2013 08:59 AM |
Yes, but then you can't use LocalPlayer anymore.
|
|
|
| Report Abuse |
|
|
Saodo
|
  |
| Joined: 26 Jul 2011 |
| Total Posts: 1206 |
|
|
| 26 Oct 2013 09:03 AM |
| So what is the alternative? |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 26 Oct 2013 09:08 AM |
function SHOWGUI(hit) if hit.Parent:FindFirstChild("Humanoid") then usr = game.Players:GetPlayerFromCharacter(hit.Parent) usr.PlayerGui.ScreenGui.Frame.Visible = true end end
script.Parent.Touched:connect(SHOWGUI) |
|
|
| Report Abuse |
|
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 26 Oct 2013 09:08 AM |
Hierachy in Studio - Workspace -- Brick --- Script
- Player -- PlayerGui --- GUI ---- Element
Put a Script in the Brick, make a function that validates or we have a real Player and not just something else that touched it.
Check or the Player has a Character
Do action to PlayerGui by using pcall()
|
|
|
| Report Abuse |
|
|