adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 04 Nov 2014 12:06 AM |
No errors. It's supposed to wait until a value inside player is changed. When it's change run this code...
code-
local debounce = true game.Players.LocalPlayer.Changed:connect(function() local status = game.Players.LocalPlayer:FindFirstChild("Status1") if status ~= nil and debounce == true then debounce = false while true do if status.Value > 0 then script.Parent.Ready.Value = false script.Parent.Status.Visible = false script.Parent.StatusFalse.Visible = true while true do wait(1) status.Value = status.Value - 1 print(status.Value) if status.Value <= 0 then debounce = true break end end end if status.Value <= 0 then script.Parent.Ready.Value = true script.Parent.StatusFalse.Visible = false script.Parent.Status.Visible = true debounce = true end break end debounce = true end end)
|
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 04 Nov 2014 12:14 AM |
Add some random prints and see what happens
is it a local script |
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 04 Nov 2014 12:21 AM |
| I did and yes it's a local script. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 04 Nov 2014 12:25 AM |
| So whats it doing and what should it be doing |
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 04 Nov 2014 12:31 AM |
It does literally nothing. It's supposed to checked if an int value inside player is larger than 0 if it is then these gui labels become visible or non-visible.
But if you test in play solo and add prints in these locations --->
Code-
local debounce = true game.Players.LocalPlayer.Changed:connect(function() local status = game.Players.LocalPlayer:FindFirstChild("Status1") if status ~= nil and debounce == true then print(1) <-----------------HERE debounce = false while true do if status.Value > 0 then print(2) <-----------------HERE script.Parent.Ready.Value = false script.Parent.Status.Visible = false script.Parent.StatusFalse.Visible = true while true do print(3) <-----------------HERE wait(1) status.Value = status.Value - 1 print(status.Value) if status.Value <= 0 then debounce = true break end end end if status.Value <= 0 then script.Parent.Ready.Value = true script.Parent.StatusFalse.Visible = false script.Parent.Status.Visible = true debounce = true end break end debounce = true end end)
---------------------- In output nothing occurs... But when you press reset. the output changes. 1,2, and 3 apprear 1 each and in order in output... Only when I press reset tho? |
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 04 Nov 2014 07:33 AM |
| Does it say where the stack ends? No output at all? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 04 Nov 2014 11:13 AM |
Try changing local status = game.Players.LocalPlayer:FindFirstChild("Status1")
to
local status = game.Players.LocalPlayer:waitForChild("Status1")
|
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 04 Nov 2014 06:11 PM |
No errors in output... It worked at once but it wasn't how I wanted... It's supposed to change a bool value to true/false then make a few gui's visible = true/false... If ready == false then it counts down from an intvalue put into player by other script. It's not changing gui's visibility and it's not counting down the timer...
New Code-
game.Players.LocalPlayer.Changed:connect(function() local status = game.Players.LocalPlayer:WaitForChild("Status1") local debounce = true if status ~= nil and debounce == true then debounce = false if status.Value > 0 then script.Parent.Ready.Value = false script.Parent.Status.Visible = false script.Parent.StatusFalse.Visible = true while true do wait(1) status.Value = status.Value - 1 print(status.Value) if status.Value <= 0 then break end end end if status.Value <= 0 then script.Parent.Ready.Value = true script.Parent.StatusFalse.Visible = false script.Parent.Status.Visible = true end debounce = true end end) |
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
| |
|
|
| 04 Nov 2014 07:41 PM |
Well... im not 100% sure about this but.. .Changed activates when an object is changed. it does not detect if an object inside of it is changed. so in other words, something inside of the player like a property has to be changed for this to activate... i dont think this is what you want it to do... i would use the same .Changed method on all of the children inside of the LocalPlayer instead of just using it on the localplayer. |
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 05 Nov 2014 08:17 PM |
Thank you so much!
I change change function line slightly and added this to beginning of code-
while true do status = game.Players.LocalPlayer:FindFirstChild("Status1") wait() if status ~= nil then break end end |
|
|
| Report Abuse |
|
|