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)
I tried to fix it but it just made me do things that would worsen the state of the script. "Error: (47,1) Expected 'end'(to close 'function' at line 26),got" Please help me

3 comments
Look at this- http://i.imgur.com/kesNPV7.jpg
facepalm I fixed that section, so you delete all of your script on that section, and replace it with mine. Just go with a simple function name(), and don't check to see if it's a function. You can fix those basic problems if you can write the above. Sorry if I sound rude.
Make sure you keep the OnDeath_CallBack function, because that is what caused half of your problems.