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)
When using CharacterAdded event don't use the player variable.
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(game.Players:FindFirstChild(chr.Name).UserId, id) then repeat wait() until chr.Humanoid chr.Humanoid.Died:Connect(function() wait(.3) plr:LoadCharacter() end) end end) end)