Team Changer Not Working

Hello, I have a system to change the team with a gui but when it is changed and restarted, it still appears in the first team and without tools.

This is the script:

script.Parent.MouseButton1Click:Connect(function()
	local var1 = game.Players
	local var2 = var1.LocalPlayer
	
	var2.Team = game.Teams["Coordinadora Arauco Malleco"]
	
	wait(2)
	
script.Parent.Parent.Parent.Frame.Visible = false
end)

I’m assuming this is inside a localscript
Changing a player’s team locally doesn’t replicate the change to the server. You should use a remoteevent for this

thanks for the help and thanks!

No need to do a RemoteEvent, MouseButton1Click does indeed replicate to the server.