I've made a gamepass that is supposed to make it so that when it's purchased you will get a faster respawn time, when it comes to marketplace scripts I'm not very good at them so could someone help me?
local MarketplaceService = game:GetService("MarketplaceService")
local player = game:GetService("Players")
local id = 971827976
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(chr)
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, id) then
repeat wait() until chr.Humanoid
chr.Humanoid.Died:Connect(function()
wait(.3)
plr:LoadCharacter()
end)
end
end)

3 comments
I believe you cannot do :LoadCharacter() after a player has died. Someone correct me if i'm wrong. might wanna look into this https://developer.roblox.com/en-us/api-reference/property/Players/RespawnTime?
You actually can call :LoadCharacter() on a Player that has died. And that link only shows you how to modify the respawn time for all players, not an individual one, as this gamepass seeks to achieve.
Are you getting any errors when this script runs?