1
This commit is contained in:
commit
a85391509d
211 files changed
+28903
No files matched your search
@@ -0,0 +1,32 @@
|
||||
--!strict
|
||||
-- Script in ServerScriptService.
|
||||
-- Spawns players immediately in the Hunter lobby without equipping a weapon.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
Players.CharacterAutoLoads = true
|
||||
|
||||
local lobby = workspace:WaitForChild("HunterLobby")
|
||||
local lobbySpawn = lobby:WaitForChild("Arrival Spawn") :: SpawnLocation
|
||||
|
||||
local function onCharacterAdded(player: Player, character: Model)
|
||||
task.defer(function()
|
||||
task.wait(0.2)
|
||||
if character.Parent then
|
||||
character:PivotTo(lobbySpawn.CFrame + Vector3.new(0, 4, 0))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function onPlayerAdded(player: Player)
|
||||
player.CharacterAdded:Connect(function(character)
|
||||
onCharacterAdded(player, character)
|
||||
end)
|
||||
if player.Character then
|
||||
onCharacterAdded(player, player.Character)
|
||||
end
|
||||
end
|
||||
|
||||
Players.PlayerAdded:Connect(onPlayerAdded)
|
||||
for _, player in Players:GetPlayers() do
|
||||
onPlayerAdded(player)
|
||||
end
|
||||
Reference in new issue
Block a user