Hello,
So I currently have a game where, when a player joins, they are given the option to join a team. However, when they click on a team, the character is reloaded, however when they respawn their joints break, causing them to die. I noticed that this was only happening when I used spawns, and when a team didn’t have any specific set spawns, they wouldn’t die.
Here is the game if you want to see it: https://www.roblox.com/games/6384614986/L7-Ms-Place-Number-201 (The Prisoners team does NOT have their own spawns in the game, but the guards team does, and the guards joints break once they spawn back in, but prisoners don’t. No where in my game do I have any breakjoints, only a loadcharacter)
Edit: Also, when their joints are broken, a ton of random force fields appear.
Here is the server sided script (I put in a few notes on what does what. There were too many local scripts to include):
Event.OnServerEvent:Connect(function(Player, x) -- Player clicks on a button, and it sends which team they selected.
if x == "Guard" then
for _, team in pairs(teams) do
local players = team:GetPlayers()
if #players < 8 then
if Player:WaitForChild("TeamBool").Value == false then
Bool.Value = true
Player.TeamColor = BrickColor.new("Electric blue")
Success:FireClient(Player) -- This just gives them a loading screen.
end
Player.TeamColor = BrickColor.new("Electric blue")
Success:FireClient(Player)
else
GuardError:FireClient(Player)
end
end
elseif x == "Prisoner" then
Player.TeamColor = BrickColor.new("Deep orange")
Success:FireClient(Player)
elseif x == "Criminal" then
local HasCriminalPass = MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, 15102026)
if HasCriminalPass then
Player.TeamColor = BrickColor.new("Really red")
Success:FireClient(Player)
else
MarketPlaceService:PromptGamePassPurchase(Player, 15102026)
end
end
end)
FinishedLoading.OnServerEvent:Connect(function(Player) -- This is connected when the loading screen is done loading.
Player:LoadCharacter()
Player:WaitForChild("TeamBool").Value = false
Reload:FireClient(Player) -- Sends back out the loading screen.
end)
Here are the properties for the guard spawns:
https://gyazo.com/0674ba1f9a6905fcd0726b154ad40331