|
| 23 Jul 2015 02:27 AM |
Everything works fine, but when it gets to the 'for' loop for the text to countdown, it doesn't work.
amnt = 1000 alarm = game.Workspace.AlarmForBank alarmlighting = alarm.AlarmSignal
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if (h~=nil) then local thisplr = game.Players:findFirstChild(h.Parent.Name) if (thisplr~=nil) then local stats = thisplr:findFirstChild("leaderstats") if (stats~=nil) then local score = stats:findFirstChild("Money") if (score~=nil) then game.Lighting.Guis.BankGui:Clone().Parent = thisplr.PlayerGui for i = 0,120,-1 do game.Lighting.Guis.BankGui.Countdown.Text = i wait(120) local h = Instance.new('Hint',game.Workspace) h.Text = "Robbed the bank" score.Value = score.Value + amnt end end end end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 23 Jul 2015 02:28 AM |
| You do to many checks and no debug errors! Put some else's and some prints above your ends |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jul 2015 02:38 AM |
| That won't help. It's just the text isn't changing. I know the problem, I just don't know the solution. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Jul 2015 02:39 AM |
DONT STORE ANYTHING IN LIGHTING. USE SERVERSTORAGE. YOUR TIMER WONT WORK BECAUSE YOU SET THE NUMBERS THE WRONG WAY.
FOR I = 120,0,-1 DO
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 23 Jul 2015 02:41 AM |
| She's right for once. Didn't read that. You do have lots of innapropriate checks though |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 02:49 AM |
@Time
Still doesn't work. I believed I've already tried reverting the numbers as you put it. And I knew that was right first, but because it didn't work I tried that way. :/ |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Jul 2015 02:54 AM |
script.Parent.Touched:connect(function(hit) local human = hit.Parent:FindFirstChild("Humanoid") if human then local player = game.Players:GetPlayerFromCharacter(human.Parent) if player then local stats =player:WaitForChild("leaderstats") local score = stats:WaitForChild("Money") game.ServerStorage.Guis.BankGui:Clone().Parent = player.PlayerGui for i = 120,0,-1 do player.PlayerGui.BankGui.Countdown.Text = i wait(1) end local h = Instance.new("Hint",workspace) h.Text = "Robbed the bank" score.Value = score.Value + 1 end end end)
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 03:03 AM |
@Time
The text is still not changing. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Jul 2015 03:04 AM |
look at your output.
player.PlayerGui:WaitForChild("BankGui").Countdown.Text = i
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 03:09 AM |
| Still not working. I'll figure it out, thanks for the valiant effort I appreciate it. |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 03:18 AM |
Actually, I can't figure this out. QQ
Help again? e.e |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Jul 2015 03:29 AM |
Server script. Notice I used ServerStorage. Make sure the Bankgui actually gets into the playergui
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Jul 2015 03:34 AM |
also make sure the player has leaderstats and money
local debounce = false
script.Parent.Touched:connect(function(hit) local human = hit.Parent:FindFirstChild("Humanoid") if human and not debounce then debounce = true local player = game.Players:GetPlayerFromCharacter(human.Parent) if player then local stats = player:WaitForChild("leaderstats") local score = stats:WaitForChild("Money") game.ServerStorage.Guis.BankGui:Clone().Parent = player.PlayerGui for i = 120,0,-1 do player.PlayerGui:WaitForChild("BankGui").Countdown.Text = i wait(1) end local h = Instance.new("Hint",workspace) h.Text = "Robbed the bank" score.Value = score.Value + 1 end debounce = false end end)
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 03:43 AM |
Hmm. They do.
The money changes when I remove the wait(120) but it just seems not to want to countdown. |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Jul 2015 04:01 AM |
Open up a new studio. Paste that code in. Watch it work. I literally just tested it in my studio and it works.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 04:24 AM |
| I'm testing it, and I'm being completely honest. It all works, it's just the damn countdown. Current and new places. |
|
|
| Report Abuse |
|
|