*** THIS QUESTION HAS BEEN ANSWERED***
i made a new team change gui. the team change is working. but players are not spawning on there team spawns. i made sure that the 4 spawns are not set to Neutral, and that the team colors. are the same. as the team.
also sorry about the title. for some odd reason, it was not letting use any other title
https://gyazo.com/35394477e5870871dd5b714ef549ed1f https://gyazo.com/f301ba09f5f84387ee7fd08e08587be1
--local script--
local Player = game.Players.LocalPlayer local Teams = game:GetService("Teams") script.Parent.MouseButton1Click:Connect(function() if Player then Player.Team = Teams:FindFirstChild("Hostiles") game.ReplicatedStorage.TeamChange:FireServer() end end)
--script for remote--
game.ReplicatedStorage.TeamChange.OnServerEvent:Connect(function(Player) Player:LoadCharacter() end)
From what I see, there's a little couple of errors.
When you fire RemoteEvents to the server, just make sure you capitalize it right, so instead of fireServer(), it should be FIreServer()
As well as that, to change the teams, you need to do that on the server, so it shows across everyone, so you'd need to send the server some info too. (If you change the player's team on the client, it only shows their team change to themselves, no everyone else)
Local Script
local Player = game.Players.LocalPlayer local Teams = game:GetService("Teams") script.Parent.MouseButton1Click:Connect(function() if Player then --Just to note, this isn't needed as it's on the client. You can still keep it in though. game.ReplicatedStorage.TeamChange:FireServer(Player) --Capitalize that "F"! Also, send the player to the server so they can change the team! end end)
Server Script
game.ReplicatedStorage.TeamChange.OnServerEvent:Connect(function(Player) Player.Team = game.Teams.Hostiles Player:LoadCharacter() end)
All in all, you just need to remember how the "grammar" involved with RemoteEvents is, and that teams need to be changed on the server. Hopefully this helps you out, and if there's some issues with it, lemme know!
EDIT: I am aware that he has used this answer for his question. He has told me he just didn't know how you accepted answers for the question.