i have issue that i want to increase player jump height then player team is playing but jump height increasing even then player team is lobby. Script type is normal script and it placed in ServerScriptService
local t1 = game.Teams.Playing
local t2 = game.Teams.Lobby
local t1P = {}
local t2L = {}
local function check()
t1P = {}
t2L = {}
for i,v in pairs(game.Players:GetPlayers()) do
if v.Team == t1 then
table.insert(t1P,v)
elseif v.Team == t2 then
table.insert(t2L,v)
end
end
end
local play = coroutine.create(function()
while task.wait(5) do
check()
for i, v in pairs(t1P) do
if v.Character then
local player = game.Players:GetPlayerFromCharacter(v.Character)
local h = v.Character:FindFirstChild("Humanoid")
if h then
local counter = false
h.JumpHeight += 5
print("+5")
h.Died:Connect(function()
if player and player.Team == t2 then
h.JumpHeight = 7.2
if counter == false then
print("end reutrn")
return
end
end
end)
end
end
end
end
end)
game.Players.PlayerAdded:Connect(function()
check()
end)
coroutine.resume(play)