You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Oyunculara erişme
local Players = game:GetService("Players")
local function addSpawn(spawnLocation)
-- listen for the spawn being touched
spawnLocation.Touched:Connect(function(hit)
local character = hit:FindFirstAncestorOfClass("Model")
if character then
local player = Players:GetPlayerFromCharacter(character)
if player and player.RespawnLocation ~= spawnLocation then
local humanoid = character:FindFirstChildOfClass("Humanoid")
-- Oyuncu ölmediyse
if humanoid and humanoid:GetState() ~= Enum.HumanoidStateType.Dead then
print("spawn set")
-- Spawnpoint'i ayarla
player.RespawnLocation = spawnLocation
end
end
end
end)
end
local firstSpawn
-- Workspace üzerindeki tüm parçaları azalarak sıralama
for _, descendant in pairs(workspace:GetDescendants()) do
-- Obje SpawnPoint öğesisi
if descendant:IsA("SpawnLocation") then
-- SpawnPoint'in ismi FirstSpawn ise
if descendant.Name == "FirstSpawn" then
--- İlk spawnpoint noktasını belirleme ve firstSpawn objesine atama
firstSpawn = descendant
end
addSpawn(descendant)
end
end
-- Her oyunucuyu ilk spawnpoint üzerinde doğurma
local function playerAdded(player)
player.RespawnLocation = firstSpawn
end
-- Oyuncular oyuna bağlandığında metot çalıştırma
Players.PlayerAdded:Connect(playerAdded)
The text was updated successfully, but these errors were encountered:
-- Oyunculara erişme
local Players = game:GetService("Players")
local function addSpawn(spawnLocation)
-- listen for the spawn being touched
spawnLocation.Touched:Connect(function(hit)
local character = hit:FindFirstAncestorOfClass("Model")
if character then
local player = Players:GetPlayerFromCharacter(character)
if player and player.RespawnLocation ~= spawnLocation then
local humanoid = character:FindFirstChildOfClass("Humanoid")
end
local firstSpawn
-- Workspace üzerindeki tüm parçaları azalarak sıralama
for _, descendant in pairs(workspace:GetDescendants()) do
-- Obje SpawnPoint öğesisi
if descendant:IsA("SpawnLocation") then
-- SpawnPoint'in ismi FirstSpawn ise
if descendant.Name == "FirstSpawn" then
--- İlk spawnpoint noktasını belirleme ve firstSpawn objesine atama
firstSpawn = descendant
end
end
-- Her oyunucuyu ilk spawnpoint üzerinde doğurma
local function playerAdded(player)
player.RespawnLocation = firstSpawn
end
-- Oyuncular oyuna bağlandığında metot çalıştırma
Players.PlayerAdded:Connect(playerAdded)
The text was updated successfully, but these errors were encountered: