✓ Accepted answer
Hello! I believe I have a solution..
Insert a RemoteEvent into ReplicatedStorage. Call it ChangeTeam.
Insert a LocalScript into StarterGui and insert this:
local p = workspace["YourPartName"]
local sg = Instance.new("SurfaceGui",game.Players.LocalPlayer.PlayerGui)
sg.Face = Enum.NormalId.Front
sg.Adornee = p
local tb = Instance.new("TextButton",sg)
tb.Size = UDim2.new(1,0,1,0)
tb.TextScaled = true
tb.Text = "hello xd"
tb.MouseButton1Click:Connect(function()
game.ReplicatedStorage.ChangeTeam:FireServer()
end)
Now insert a Script into ServerScriptService and insert this:
game.ReplicatedStorage.ChangeTeam.OnServerEvent:Connect(function(p)
p.Team = game.Teams["ello B) 2"]
p:LoadCharacter()
end)
Hope this helps!
2 comments
ok thanks, i will try this
yo it worked, thank you