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

Why won't the GamePass work?

Asked by 9 years ago
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)

Lines 1-7

Answer this question