So i want to make a round system and the thing is i want to make a FFA system.
I made already the kill trigger and it saves it, but i want to sort the kills and player name in a table as both values at once.
I made it kinda but idk how to update the value/sort the values so the gui updates(there is no gui script)
local Timer = game.ReplicatedStorage.Events.RoundEvents:WaitForChild("Timer")
local InRound = game.ReplicatedStorage.Round:WaitForChild("InRound") -- BoolValue from Round
local KillEvent = game.ReplicatedStorage.Events.FPS:WaitForChild("KillEvent")
local Playertable = {}
InRound.Changed:Connect(function(Val)
if Val == true then
print("round start")
elseif Val == false then
print("round over")
table.clear(Playertable)
local players = game.Players
for i, v in players:GetChildren() do
for i, e in v:GetChildren() do
if e.Name == "KillsR" then
e.Value = 0
end
end
end
end
end)
game.Players.PlayerAdded:Connect(function(plr)
local KillsRound = Instance.new("IntValue") -- makes a intValue so i can accses it
KillsRound.Name = "KillsR"
KillsRound.Parent = plr
table.insert(Playertable, {plr, KillsRound.Value})
end)
KillEvent.Event:Connect(function(plr)
if InRound.Value == true then
local Kills = plr.KillsR
for i,v in Playertable do
local PlayerT = table.find(v, plr)
print(PlayerT)
for i, e in PlayerT:GetChildren() do
if e:IsA("IntValue") then
Kills.Value += 1
e = Kills.Value
end
end
end
end
end)