So I’m building a game for someone and I was setting up spawns but I’m not spawning where I would like to spawn. I correctly matched the colours and all that but I don’t spawn at the right place.
Post your script.
Hey make sure the properties of your spawn locations are set correctly.
Spawns have a property called “Neutral”. Make sure to set that to false as that can cause the issue.
Already unchecked those. I tried everything.
I already did everything I had to do. I even looked up tutorials but I can’t find anything wrong.
My script only changes the teams. I tried using admin to change teams but same result.
If the player is loaded in when they join they are spawning where the spectators are supposed to spawn because you have that team set to autoassignable
. I would not load the character until they select a team, that way when they press play they spawn where they are supposed to.
And how do I prevent a character from loading? I’m kinda new to scripting so I don’t know how to delay things or stuff like that.
You could also just teleport them to the spawn when they press play, or you can do this method:
Set CharacterAutoLoads property to false in the Players
tab in explorer.
then when they press the play button fire a remote event telling them to load the character.
Local Script
game.ReplicatedStorage.LoadCharacter:FireServer() --Put where they press the play button
Server Script (In serverscriptservice)
game.ReplicatedStorage.LoadCharacter.OnServerEvent:Connect(function(player)
player:LoadCharacter()
end)
Here it is
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local PlayButton = script.Parent.TextButton
local Frame = script.Parent.Frame
local up = script.Parent.Update
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.Folder.CameraPart.CFrame
PlayButton.MouseButton1Click:Connect(function()
Camera.CameraType = Enum.CameraType.Custom
PlayButton:Destroy()
Frame:Destroy()
up:Destroy()
end)
So you’re not setting the player spawn via the script?
I thought that it was unnecessary because the team spawns have already been linked to the teams so all you have to do is reset.
If it isn’t working then you can easily set it using Player.SpawnLocation. Could you try printing Player.SpawnLocation.Name?
You should also read this to make sure you’ve set everything correctly (e.g SpawnLocation.Neutral):
https://developer.roblox.com/en-us/api-reference/class/SpawnLocation