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

prevent humanoid spawning off the map?

Asked by 5 years ago

I am having a problem with respawning a player when it dies. as sometimes the player spawn outside the map like this picture.

I think this problem started when I use ClonedMap:Destroy() after the game ended thus making the player respawning off the map.

is there any script that I can use to prevent the player from respawning off the map after it dies or when the maps changes?

here is the full code.

001local PointsService = game:GetService("PointsService")
002local ReplicatedStorage = game:GetService("ReplicatedStorage")
003local ServerStorage = game:GetService("ServerStorage")
004local MapsFolder = ServerStorage:WaitForChild("Maps")
005local Status = ReplicatedStorage:WaitForChild("Status")
006local GameLength = 150
007local reward = 50
008 
009while true do
010 
011Status.Value = "waiting for players"
012repeat wait(1) until game.Players.NumPlayers >= 2
013Status.Value = "intermission"
014wait(10)
015 
View all 121 lines...
0
Maybe You can have the players respawn in a remote area then CFraming thier root parts into your desired location may work. Fad99 286 — 5y
0
Set the CFrame of the HumanoidRootPart to a part at your spawn map. xJigoku 17 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Make the script create a spawn pad, Remove the decal, make it transparent, then wait until the player respawns, then destroy the spawn pad. Or make it no collisions

Ad

Answer this question