generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help? Not working, no ouput.

Previous Thread :: Next Thread 
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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 is not online. 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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
23 Jul 2015 02:29 AM
*output

Sorry, it's late.
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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 is not online. 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 is not online. 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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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 is not online. 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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
23 Jul 2015 03:03 AM
@Time


The text is still not changing.
Report Abuse
TimeTicks is not online. 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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
23 Jul 2015 03:09 AM
Still not working. I'll figure it out, thanks for the valiant effort I appreciate it.
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
23 Jul 2015 03:18 AM
Actually, I can't figure this out. QQ

Help again? e.e
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
23 Jul 2015 03:28 AM
Bump.
Report Abuse
TimeTicks is not online. 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 is not online. 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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
23 Jul 2015 03:59 AM
bump
Report Abuse
TimeTicks is not online. 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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image