i made a script so a othe script will only function when your on a specific team but the scrit does not stop even if im on a different team. I also want the script to enable again when I go back on the team, please help.
The localscript in starterplayerscripts:
local player = game.Players.LocalPlayer
if player.Team.TeamColor == game.Teams.Alive.TeamColor then
local StarterGui = player.PlayerGui
local UserInputService = game:GetService("UserInputService")
UserInputService.JumpRequest:Connect(function()
StarterGui.ScreenGui.Frame.Visible = true
wait(6)
StarterGui.ScreenGui.Frame.Visible = false
end)
end
local player = game.Players.LocalPlayer
if player.Team.TeamColor == game.Teams.Alive.TeamColor then
while true do
local StarterGui = player.PlayerGui
local UserInputService = game:GetService("UserInputService")
UserInputService.JumpRequest:Connect(function()
StarterGui.ScreenGui.Frame.Visible = true
wait(6)
StarterGui.ScreenGui.Frame.Visible = false
end)
end
