Hello! I'm making an obby and I have a script in ServiceScriptService that determines whether or not you will be killed by a kill part if you have a certain gamepass. However, the script only works with one kill brick, not all. So, I'm wondering how I can make this script work with every part with the same name.
Here's the script that I have.
local id = (id here)
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
if purchased and id == ido then
game.Workspace.LavaBrick.Script.Disabled = true
end
end)
game.Players.PlayerAdded:Connect(function(plr)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId.id)then
game.Workspace.LavaBrick.Script.Disabled = true
end
end)

1 comment
Okay, thank you!