Alright, I am trying to make a good terminal script for my groups base but, It isn't working...
01 | local wintime = 1200 |
02 | local totaltime = 1200 |
03 | local timegodown = 1 -- how many seconds of time go down for the term |
04 | local h = Instance.new( "Hint" ) |
05 | script.Parent.Touched:connect( function (hit) |
06 | if hit.Parent:findFirstChild( "Humanoid" ) ~ = nil then |
07 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
08 | if player then |
09 | if player.TeamColor = = BrickColor.new( "Really black" ) then |
10 | script.Parent.BrickColor = BrickColor.new( "Really black" ) |
11 | h.Parent = game.Workspace |
12 | h.Text = "The Necromongers Own the Term!" |
13 | wait( 3 ) |
14 | h:Remove() |
15 | end |
It's because you're telling it to print the same value each time.
wintime = 1200 timegodown = 1
wintime-timegodown = 1199
It's going to output this every time because that's what it equals.
You need to do something like this:
1 | while wait() do |
2 | h.Text = "The Necromongers have " .. wintime .. " seconds left before Winning!" |
3 | wintime = wintime-timegodown -- This assigns a new value to wintime each time thus dropping it by 1 each time giving you the result I believe you're looking for. |
4 | end |
Hope this helped!
You need to add somewhere in your script:
1 | timegodown = timegodown - 1 |