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 » Scripting Helpers
Home Search
 

Re: Terminal Timer Problem

Previous Thread :: Next Thread 
3xpert is not online. 3xpert
Joined: 11 May 2013
Total Posts: 1513
18 Jul 2013 08:01 PM
Code :
timetowin = 1200
totaltime = 1200
h = instance.new("Hint",game.Workspace)

while wait() do
if game.Workspace.CurrentOwner.Value == 3 then
h.Text = "Raiders win in".." "..timetowin.." seconds!"

if timetowin <= totaltime and timetowin > 0 and CurrentOwner.Value == 3 then
wait(1)
timetowin = timetowin - 1
end


elseif timetowin <= totaltime and timetowin > 0 and game.Workspace.CurrentOwner.Value == 2 then
repeat wait(1) timetowin = timetowin + 1 until timetowin == totaltime
end
end

if timetowin == 0 then
h:Destroy()
win = Instance.new("Message")
win.Parent = game.Workspace
win.Text = "The raiders have won!"
wait(5)
win:Destroy()

game.Workspace.CurrentOwner.Value = 1
timetowin = totaltime
end

Problem : No hint pops up when captured.
The currentOwner crap is defined in a different script, but that one is working fine.
I don't know why it isn't working, some one please help!
Report Abuse
3xpert is not online. 3xpert
Joined: 11 May 2013
Total Posts: 1513
18 Jul 2013 08:17 PM
Bump.
Someone, please help, I really want this fixed ASAP. I know it's long, but come on D:
Report Abuse
dewd45 is not online. dewd45
Joined: 08 Mar 2009
Total Posts: 11180
18 Jul 2013 08:19 PM
Change win:Destoy()
to
--i need to give dewd45 some robux

#swagyolo
Report Abuse
3xpert is not online. 3xpert
Joined: 11 May 2013
Total Posts: 1513
18 Jul 2013 08:57 PM
Serious answers only please.
Report Abuse
3xpert is not online. 3xpert
Joined: 11 May 2013
Total Posts: 1513
18 Jul 2013 09:10 PM
Bump
Report Abuse
Christbru01 is not online. Christbru01
Joined: 03 Apr 2010
Total Posts: 649
18 Jul 2013 09:11 PM
timetowin = 1200
totaltime = 1200
h = Instance.new("Hint",game.Workspace) --EDIT 1

while wait() do
if game.Workspace.CurrentOwner.Value == 3 then
h.Text = "Raiders win in".." "..timetowin.." seconds!"

if timetowin <= totaltime and timetowin > 0 and CurrentOwner.Value == 3 then
wait(1)
timetowin = timetowin - 1
end


elseif timetowin < totaltime and timetowin > 0 and game.Workspace.CurrentOwner.Value == 2 then --EDIT 2
wait(1) timetowin = timetowin + 1 --EDIT 3
end
end

if timetowin == 0 then
h:Destroy()
win = Instance.new("Message",workspace) --EDIT 4
win.Text = "The raiders have won!"
wait(5)
win:Destroy()

game.Workspace.CurrentOwner.Value = 1
timetowin = totaltime
end


EDIT 1: Capitolize the i in instance
EDIT 2: I'm assuming CurrentOwner 2 is the ally/main team, and as such you want to run the loop only until it actually reaches the max time, so <= needs to be < because <= would run it one more time after it reaches the max, making time to win one more than total time... which would then break the script as the CurrentOwner 3 scans to make sure it isn't over totaltime...
EDIT 3: That would have stopped the script from moving on to anything else, and sat there, counting up the time to win by one each second until it reached the max, then it'd have continued running the rest of the script... basically meaning that once team 2 took it it'd count up no matter who has it, until it reaches the max, which is when it'd start moving back down if team 3 had it...
EDIT 4: Not a mess up but it is a lil bit cleaner and faster to simply supply workspace as the second argument in Instance.new, so that it creates the Message inside of workspace without you having to set it yourself... mainly just saves an extra line xD
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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