I tested this script, and it worked, but when I test a server it doesn't work.. It's supposed to spawn the player in a specific team and load the character but it only works when I test in general in studio but in a server it doesn't work at all.. I tried to make the main script a local script but it doesn't work neither on server or on client. On server or studio there are no errors..
Main script(Parent=Workspace, ServerScript)
game.ReplicatedStorage.PlayerSpawn.OnServerEvent:Connect(function(plr)
local house = plr.PlayerGui:WaitForChild("GameChooseGUI").Frame
local t = house.PlayButton.Text
plr.PlayerGui.GameChooseGUI.Frame.Visible = false
plr.TeamColor = BrickColor.new("Bright red")
plr:LoadCharacter()
house:Destroy()
end)
GUI Script(Parent=PlayButton, LocalScript)
local plr = game.Players.LocalPlayer
local house = plr.PlayerGui:WaitForChild("GameChooseGUI").Frame
local t = house.PlayButton.Text
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.PlayerSpawn:FireServer()
end)

1 comment
alright! sorry for the 7-day delay but It worked