Hello I am new to coding and this one strip of code has gotten me stumped.
Here it is.
if #plrs == 1 then
--They won wow
Status.Value = "The conquerer is.."..plrs(1).Name --The error is this row
plrs(1).leaderstats.Bucks.Value = plrs(1).leaderstats.Bucks.Value + reward
break
plrs is a local table of how many players are left in the game and here i am trying to get their name to show up when they are the last player left alive. Though when there is one player left it just continues showing the status text that shows when the game is playing which is.
"There are # seconds remaining and # players remaining!"
When the players remaining goes down to 1 the status stops updating and says
"There are # seconds remaining and 1 players remaining!"
The seconds stop going down and nothing happens. What i want to happen is the status text to be updated to.
"The conquerer is.. (last person alive's name)!"
Thanks for help in advance.

1 comment
Replace the
(1)with[1]because you index tables usingbracketsnotparentheses