NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 May 2014 10:34 PM |
It's not debounce's fault, it's the scripter's fault. Can you post that section here? |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 May 2014 10:37 PM |
debounce = false script.Parent.Touched:connect(function(hit) plr = hit.Parent hum = plr:FindFirstChild("Humanoid") if (hum~=nil) then debounce = true plr.PlayerGui.Shop.Frame.Visible = false wait(1) debounce = false end end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 May 2014 10:37 PM |
But plr.PlayerGui is not going to exist since you are referencing the character.
local plr = Game.Players:GetPlayerFromCharacter(hit.Parent); local hum = script.Parent:FindFirstChild("Humanoid"); |
|
|
| Report Abuse |
|
|
|
| 16 May 2014 10:38 PM |
| But that script makes your gui disappear |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 May 2014 10:42 PM |
debounce = false script.Parent.Touched:connect(function(hit) if debounce then return end plr = hit.Parent hum = plr:FindFirstChild("Humanoid") if (hum~=nil) then debounce = true plr.PlayerGui.Shop.Frame.Visible = false wait(1) debounce = false end end)
Forgot something. |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 May 2014 12:31 PM |
Try this
local debounce = false; script.Parent.Touched:connect(function(hit) if debounce or not(hit and hit.Parent) then return; end local plr = Game.Players:GetPlayerFromCharacter(hit.Parent); local hum = script.Parent:FindFirstChild("Humanoid"); if plr and hum then local frame = plr.PlayerGui:FindFirstChild("Shop") and plr.PlayerGui.Shop:FindFirstChild("Frame"); if frame then debounce = true; frame.Visible = false; wait(1); debounce = false; end end end) |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 May 2014 12:54 PM |
| add print(frame) before if frame, see if it's nil |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 May 2014 01:00 PM |
| Add prints every other line, see where it stops. |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 May 2014 01:06 PM |
Even before line 3? Is your script disabled or something because something for sure should of printed on line 2 when you touched it, and line 1 |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 May 2014 01:13 PM |
The line 3 one didn't print when you touched the part?
local debounce = false; print("A"); script.Parent.Touched:connect(function(hit) print("B"); if debounce or not(hit and hit.Parent) then return; end print("C"); ...
see if it reaches C |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|