-
What do you want to achieve?
Oh it’s probably easy to fix, all I need is a line that includes the vector of the random spawns. -
What is the issue?
“Unable to assign property Position. Vector3 expected, got Instance”, Instance referring to the actual spawnLocation, when I want to use their position instead of the actual spawnLocation in a folder in workspace.
My server script: Everything works flawlessly except that line of code cuz I am not really good yet with math.random nor mathematical usage.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(model)
game.ReplicatedStorage.SetSpawn.OnServerEvent:Connect(function()
--player.RespawnLocation = game.Workspace.SpawnLocation1
local hirp = model:WaitForChild("HumanoidRootPart")
hirp.Position = game.Workspace.SpawnL:GetChildren()[math.random(1, #game.Workspace.SpawnL:GetChildren())]
print("worked")
end)
end)
end)