Ad
Log in to vote
0

how i give 1 win point just to the players that are still alive at the end of the round?

Asked by 6 days ago
Edited 6 days ago

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.

2
on player added, add a BoolValue into the player (NOT THE CHARACTER). When the player starts playing the game, set the value too true. If he looses, set the value too false. At the end of the round loop through all the players in game. If the value of the boolValue in a player is True then give them a point. Reply if you have any questions. msculenny 2 — 6d

Answer this question