Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying to make players spawn at a certain spawn before game starts?

Asked by
gitrog 326 Moderation Voter
6 years ago
Edited 6 years ago

Alright, so my game has a menu when you first join. I want the player to spawn on one SpawnLocations when they first join and they see the menu, and them to spawn randomly on one of the other SpawnLocations as usual after leaving the menu. I have MenuSpawn disabled. However, it spawns me as usual.

I cut out the parts that aren't relevant to the problem.

game.Players.PlayerAdded:connect(function(player)
    local menuActive = true
    player.RespawnLocation = game.Workspace.MenuSpawn

    player.CharacterAdded:connect(function(character)
        if menuActive then
            menuActive = false
        end
    end)
end)
0
'connect' is deprecated. Use 'Connect'. Thundermaker300 554 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

The property RespawnLocation needs to contain a reference to a SpawnLocation object, not a part.

Ad

Answer this question