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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 11 May 2013 |
| Total Posts: 1513 |
|
|
| 18 Jul 2013 08:57 PM |
| Serious answers only please. |
|
|
| Report Abuse |
|
|
3xpert
|
  |
| Joined: 11 May 2013 |
| Total Posts: 1513 |
|
| |
|
|
| 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 |
|
|