I made a recent question with the same topic. However I am still having the same problem, I originally fixed it by turning off FilteringEnabled. However, FE is now a must, do to recent updates. The team switch script works just fine, it switches your team and doesn't have any difficulties.
--This is a local script
local player = game.Players.LocalPlayer
function onButtonClicked()
player.TeamColor = BrickColor.new("Bright red")
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
Unfortunately, the kill script works, except it doesn't respawn you at the intended team spawn, instead it keeps you at the lobby spawn even if you click it repeatedly. Not only that but, the system in place that's supposed to -1 to your Wipeouts when you click the team switch button also doesn't work. Here is the script for this...
--This is a normal script
player = game.Players.LocalPlayer
function onButtonClicked()
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
player.leaderstats.Wipeouts.Value = player.leaderstats.Wipeouts.Value - 1
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
I am extremely inexperienced when it comes to integrating Filtering Enabled, I understand you are supposed to use RemoveEvents and RemoveFunctions but I don't know exactly how to use those when it comes to these scripts or really how to properly use them at all.
EDIT: I managed to get it working properly in studio to where it spawns you in the corresponding spawn and doesn't confine you to the lobby. I used this tutorial to do it: https://www.youtube.com/watch?v=wic-N4JiFss&t=559s. However, I was not able to get it working in game despite using remote events and all. When I clicked the buttons they didn't even do anything at all.

7 comments
Your first problem is you can't use LocalPlayer in a normal script.
What's a normal script?
What do you suggest I replace "LocalPlayer" with?
What's a normal script? @forceoh777
@incapaz http://wiki.roblox.com/index.php?title=API:Class/Script
That's a script. No such thing as a normal script exists.
By normal script, I meant a non-modular and non-local, plain, normal script.