So I have a script for changing teams in a GUI, it looks like this.
function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Institutional white")
script.Parent.Parent.Parent:Destroy() --destroys the IntroGUI
local StarterGui = Game:GetService('StarterGui')
StarterGui:SetCoreGuiEnabled (Enum.CoreGuiType.PlayerList, true) --enables playerlist
StarterGui:SetCoreGuiEnabled (Enum.CoreGuiType.Backpack, true) --enabled backpack
game.Lighting.Blur.Size = 0 --disabled the blur
game.Players.LocalPlayer.Character.Humanoid.Health = 0 --kills player so they go to their spawn
end
script.Parent.MouseButton1Down:connect(Click)
Now it works fine but not perfect, such as, this game has a death counter and doing
game.Players.LocalPlayer.Character.Humanoid.Health = 0
of course kills them, adding up to the death counter, Ive tried
game.Players.LocalPlayer:LoadCharacter()
instead of
game.Players.LocalPlayer.Character.Humanoid.Health = 0
But it doesnt work in-game with Filtering Enabled.
