truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
|
| 13 Feb 2014 11:50 AM |
Hi, I've created a script so that a GUI appears when a player walks up to a door. However, if there are more than 1 doors in the game, the GUI only appears at one, but doesn't appear at the other when they walk to it.
How do I make it so that all doors work when you walk up to them instead of just one? Thank you for any help. SCRIPT (it doesn't seem to work if I just paste it in this post?):
http://pastebin[DOT]com/stSNjj54
|
|
|
| Report Abuse |
|
|
truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
|
| 13 Feb 2014 12:10 PM |
| No guidance on what to do? |
|
|
| Report Abuse |
|
|
truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
| |
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 13 Feb 2014 01:28 PM |
| You are probably moving the GUI, Use the :Clone() method and move it. |
|
|
| Report Abuse |
|
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 13 Feb 2014 01:29 PM |
| And move the clone, not the original |
|
|
| Report Abuse |
|
|
truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
|
| 13 Feb 2014 01:32 PM |
I made it so when the player equips the tool, a lockpick gui is cloned to their playergui. The script makes it so that when they walk near a door, it makes the gui visible.
|
|
|
| Report Abuse |
|
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 13 Feb 2014 01:33 PM |
| Weird, I will look into your script, give me some time. |
|
|
| Report Abuse |
|
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 13 Feb 2014 01:35 PM |
| Btw, this script will make it visible to all players, if one player does it. Is that what you wanted? |
|
|
| Report Abuse |
|
|
truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
|
| 13 Feb 2014 01:37 PM |
| Ah, no. It doesn't seem to work in a local script. How do I fix that problem? |
|
|
| Report Abuse |
|
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 13 Feb 2014 01:40 PM |
Sorry, I'm a lazy person. I'm not going to type up a script, but I will tell you what you need to do.
.Touch:connect(function(h) -- Connects when something touches if h.Parent:findFirstChild('Humanoid') then -- checks if it's a player plr = game.Players:GetPlayerFromCharacter(h.Parent) -- Gets the player gui:Clone().Parent = plr.PlayerGui -- Gives the gui |
|
|
| Report Abuse |
|
|
truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
|
| 13 Feb 2014 01:49 PM |
Ok, thanks.
I fixed the problem by adding debounce. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2014 02:33 PM |
| Why not just add an overlay function... |
|
|
| Report Abuse |
|
|