Well, if I recall correctly, LoadCharacter can only be called on the Server. To use LoadCharacter in this sense, you'd have to use A RemoteEvent. Here's an example:
Hierarchy:
ReplicatedStorage.LoadChar[RemoteEvent]
ServerScriptService.RemoteHandler[Script]
LocalScript:
1 | script.Parent.MouseButton 1 Click:connect( function () |
2 | game.Players.LocalPlayer.TeamColor = BrickColor.new( "Light stone grey" ) |
3 | game.Players.LocalPlayer:LoadCharacter() |
4 | print (game.Players.LocalPlayer.Name.. " has changed team to " ..script.Parent.Name.. " team!" ) |
ServerScript:
1 | game:GetService( "ReplicatedStorage" ).LoadChar.OnServerEvent:connect( function (player) |
(Please Note: I wrote this in the ScriptingHelper's question editor, so pardon any mistakes.)