Okay so i'm trying to do a gamepass that let's people spawn faster. It won't work but can someone fix this?
local passId = 253208787
function isAuthenticated(player)
return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end
game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then
SpawnDelayTime = 0
OnDeath_Callback = function(player)
print(player.Name .. " died. Awaiting respawn.")
end
game.Players.CharacterAutoLoads = false
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
local t = time()
while ((not c:FindFirstChild("Humanoid")) and ((time()-t) < 10)) do wait(0.2) end
if ((time()-t) >= 10) then print("Timeout error")
else
c.Humanoid.Died:connect(function()
if (type(OnDeath_Callback) == "function") then OnDeath_Callback(p) end
wait(SpawnDelayTime)
p:LoadCharacter(true)
end)
end
end)
wait(2)
p:LoadCharacter(true)

1 comment
What do you mean it won't work? Can you tell us if there is any output? What prints? Which lines contain the error... most likely