--The reason that the script would not work is because the QueCountdown was getting to -1 because i was changing it manually right before it ticked down. I made a loop that fixes this error and it works now. Thanks for reading
This loop is supposed to set "workspace.Winner.Value" to another value that is in the workspace. Everything in the loop works up until the line that sets its value. (workspace.Winner.Value = Entry.Name)
any idea why it wont work?
function HowManyPlayers() local NumberOfParts = workspace.Roster:GetChildren() return #NumberOfParts end while true do wait() if HowManyPlayers(workspace.Roster) == 1 and workspace.Winner.Value == "" and workspace.QueCountdown.Value == 0 then workspace.TourneyTime.Value = 20 workspace.TourneyTime.Countdown.Disabled = false workspace.QueCountdown.Value = 2 workspace.QueCountdown.Countdown.Disabled = false local Entry = workspace.Roster:FindFirstChild(Player.Name) if Entry ~= nil then workspace.Winner.Value = Entry.Name local Message = Instance.new("Message") Message.Parent = workspace Message.Text = ""..workspace.Winner.Value.." Has Won the Tourney. Glory to their house!" local Rekt = workspace.RemoveMessageScript:Clone() Rekt.Parent = Message Rekt.Disabled = false local Reward = math.random(1,5000) if Reward ~= 5000 and Player.Name == workspace.Winner.Value then Player.Stats.Money.Value = Player.Stats.Money.Value + 1000 Player.Character.Humanoid.Health = 0 elseif Reward == 5000 and Player.Name == workspace.Winner.Value then print("Mini Punches") Player.Character.Humanoid.Health = 0 end end end end
thanks for reading
Make sure it's a string value. Otherwise, it won't work.