Bzrk262
|
  |
| Joined: 27 Dec 2012 |
| Total Posts: 23 |
|
|
| 14 Nov 2015 02:09 PM |
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local secs = Instance.new("IntValue") secs.Name = "Seconds" secs.Value = 0 local mins = Instance.new("IntValue") mins.Name = "Minutes" mins.Value = 0 local hrs = Instance.new("IntValue") hrs.Name = "Hours" hrs.Value = 0
secs.Parent = stats mins.Parent = stats hrs.Parent = stats stats.Parent = newPlayer while true do wait(1) secs.Value = secs.Value + 1 end while true do wait(60) mins.Value = mins.Value + 1 secs.Value = secs.Value - 60 end while true do wait(1440) hrs.Value = hrs.Value + 1 mins.Value = mins.Value - 60 end end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
Bzrk262
|
  |
| Joined: 27 Dec 2012 |
| Total Posts: 23 |
|
|
| 14 Nov 2015 02:10 PM |
The main problem is the 'while true do' bits where it doesn't subtract or add.
Note: I have also tried 'if' statements and they don't work either. |
|
|
| Report Abuse |
|
|
Bzrk262
|
  |
| Joined: 27 Dec 2012 |
| Total Posts: 23 |
|
| |
|
|
| 14 Nov 2015 02:31 PM |
| game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
xLink123
|
  |
| Joined: 07 Aug 2014 |
| Total Posts: 11158 |
|
|
| 14 Nov 2015 02:31 PM |
| It gets stuck on the first while true do and never goes onto the others |
|
|
| Report Abuse |
|
|
Bzrk262
|
  |
| Joined: 27 Dec 2012 |
| Total Posts: 23 |
|
|
| 14 Nov 2015 02:33 PM |
| I'll condense it into one and see if that works. |
|
|
| Report Abuse |
|
|
| |
|
Bzrk262
|
  |
| Joined: 27 Dec 2012 |
| Total Posts: 23 |
|
|
| 14 Nov 2015 02:38 PM |
Weird, that works now but didn't work when I did it before. Must have done something wrong!
(I'll post the working script here if anyone wants to use something similar) |
|
|
| Report Abuse |
|
|
Bzrk262
|
  |
| Joined: 27 Dec 2012 |
| Total Posts: 23 |
|
|
| 14 Nov 2015 02:42 PM |
The working script: http://www.roblox.com/item.aspx?id=319996371
The game its used in/example: http://www.roblox.com/games/256942477/Paint-The-Town-Red-v1-06 |
|
|
| Report Abuse |
|
|