im so lost, ive tried everything, and even when the player hasnt recently respawned and didnt just load in, 10 percent of the time it doesnt tp the player even tho it prints teleported player, it makes no sence
for i = 1, #module.playing do
delay(0, function()
local plr = config.ph.get_player_instance(module.playing[i])
if plr and config.ph.player_info[plr.Name] and config.ph.player_info[plr.Name].isdead or plr and plr.Character and plr.Character:FindFirstChild("Humanoid") and plr.Character.Humanoid.Health <= 0 or plr and plr.Character and plr.Character:FindFirstChild("being teleported") then repeat wait(.00001) until not plr or plr and config.ph.player_info[plr.Name] and not config.ph.player_info[plr.Name].isdead and plr.Character and plr.Character:FindFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 and not plr.Character:FindFirstChild("being teleported") end
if plr and config.ph.player_info[plr.Name] and not config.ph.player_info[plr.Name].isdead and plr.Character and plr.Character:FindFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 and not plr.Character:FindFirstChild("being teleported") and config.ph.player_info[plr.Name].game_data.alive then
game:GetService("RunService").Heartbeat:Wait()
warn("TELEPORTED - "..plr.Name)
--mabey add a loop to tp until there tped
local sp = nil
if spawns[i] then
sp = spawns[i]
else
sp = spawns[math.random(1, #spawns)]
end
repeat
plr.Character.HumanoidRootPart.CFrame = sp.CFrame + Vector3.new(0, 3.5, 0)
until plr.Character.HumanoidRootPart.CFrame == sp.CFrame + Vector3.new(0, 3.5, 0)
plr.PlayerGui.Teleport:Play()
else
print("skjdioajdiwjaoidjioawjdiwaiodjioajdojad")
local suc, er = pcall(function()
print(plr.Name)
print(config.ph.player_info[plr.Name].isdead)
print(plr.Character.Humanoid.Health)
print(config.ph.player_info[plr.Name].game_data.alive)
end)
if not suc then error(er) end
end
end)
end