It’s not that difficult once you know a few things
local SCP = where your character is
local Spawns = --go to your spawns here so game.Workspace.Maze.Spawns["SCP Model"]
--so now we need to get the children of the spawns which is just every part
Spawns = Spawns:GetChildren()
--All we have to do now is move the character to a random spawn
SCP:PivotTo(Spawns[math.random(1,#Spawns)].Position)
It’s easy to code these type of stuff once you have some coding experience.
-- We first get the SCP model, the maze and the spawns.
local SCP = YOUR_MODEL -- Set "YOUR_MODEL" to your npc (for example workspace.SCP)
local Maze = workspace.Maze -- I'm guessing It's located in workspace.
local Spawns = Maze:WaitForChild("Spawns")["SCP Model"]:GetChildren()
-- We then choose a random spawn and set the SCP's PrimaryPart (which is "HumanoidRootPart")
-- and we set that position to one of the spawns.
local ChosenSpawn = Spawns[math.random(1, #Spawns)]
SCP.PrimaryPart.Position = ChosenSpawn.Position
If you have any problems with the code, reply to me.
local SCP = your model here (ex: game.Workspace.SCP)
local spawnPointName = "SCP Spawn" -- the name of your spawn points
local spawnsFolder = Where your spawns are located
-- function to teleport SCP to a random spawn point
local function teleportSCP()
local spawnPoints = {}
-- Find all spawn points with the specified name
for _, spawnPoint in ipairs(spawnsFolder:GetChildren()) do
if spawnPoint.Name == spawnPointName then
table.insert(spawnPoints, spawnPoint.Position)
end
end
if #spawnPoints > 0 then
local randomIndex = math.random(1, #spawnPoints)
local randomSpawnPoint = spawnPoints[randomIndex]
SCP:SetPrimaryPartCFrame(CFrame.new(randomSpawnPoint))
else
warn("No spawn points found with the name: " .. spawnPointName)
end
end
-- Teleport SCP when the game starts
teleportSCP()
this will cycle the folder containing the spawnpoints so you dont have to give a diferent name for each of them
Ensure that:
You replace ‘your model here’ (line 1) with the actual reference to the SCP model
‘spawnsFolder’ (line 3) is currently set to the folder where your spawn points are located
The names of the spawn points within that folder match “spawnPointName” (line 2)