I’m making a simple obby game but have run into a problem where, when team testing, some players are spawned immediately at a further checkpoint as shown in the picture. The checkpoint spawn plate has the Neutral property turned off, the only one with it turned on is the actual desired spawn plate. Is there any way I could get all players to spawn into the game onto only one desired spawn plate?
There isn’t really a script for this question, so none provided.
I need the spawn plate to actually work and swap the player’s team when touched, the Enabled property seems to completely void the plate of all function including that, any other way?
It seems like you’re experiencing an issue where some players are spawning at a different checkpoint than the intended one. This can be caused by the Neutral property of the spawn locations. 1. Set Neutral to true for all spawn locations: Temporarily set the Neutral property to true for all spawn locations, including the one you want to use as the primary spawn point. This will make all spawn locations available to all players. 1. Use a script to control player spawning: Create a script that listens for the PlayerAdded event and sets the player’s spawn location to the desired primary spawn point. This script should be run on the server.
Here is an example
local Players = game:GetService("Players")
local SpawnLocations = game.Workspace:WaitForChild("SpawnLocations")
local function onPlayerAdded(player)
local primarySpawnLocation = SpawnLocations:FindFirstChild("PrimarySpawn") -- replace with your desired spawn location
player.RespawnLocation = primarySpawnLocation
end
Players.PlayerAdded:Connect(onPlayerAdded)
This script will set the spawn location of all new players to the primary spawn location you specify. Make sure to replace “PrimarySpawn” with the actual name of your desired spawn location.
If you name your starting spawn “MainSpawn” this code will make it so player’s start at the main spawn then change to whatever spawn their character touches:
local Players = game:GetService("Players")
local mainSpawn = workspace.MainSpawn
Players.PlayerAdded:Connect(function(player)
player.RespawnLocation = mainSpawn
player.CharactedAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid", 10)
if not humanoid then return end
humanoid.Touched:Connect(function(hit)
if hit:IsA("SpawnLocation") then
player.RespawnLocation = hit
end
end
end
end)
This just places every player that joins straight into the Spawn team, thus forcing them to only spawn on that plate as no spawn plates in the game have Neutral checked on.
This seems to have solved the problem, however your script worked as well I found. Lesson learned; instead of making a transparent spawn plate set to neutral and TeamChange set to true, but make a server script that assigns teams upon player join.