Hello, i got a script, that give you 1 win when you touch a part:
script.Parent.Touched:Connect(function(hit) local Player = game.Players:GetPlayerFromCharacter(hit.Parent) Player.leaderstats.Wins.Value = Player.leaderstats.Wins.Value + 1 wait(1) end)
but i want to change it, so i can give 1 win point trough a script(whitout needing to touch)
its just that i want to give this 1 Win just to the players that are still in the maingame at the end of the round,soo:
for i, player in pairs(game.Players:GetPlayers()) do if player then table.insert(plrs,player) -- Add player i end end
but what conditions i should give to the script to make it work proprely? also, how i make the first script to work when the script runs on it? not when someone touch the part.