I'm trying to make a special clickable model regeneration script that can only be used if you have a certain pass. I have been messing around and I created this (script below) but it doesn't work like it should, any suggestions on how I can fix this?
Script:
local buf = script.Parent.Parent.Canoe1:clone()
local deb = false
local ID = 1268461443
local CLICK_BLOCK = script.Parent
local ITEM_ID = 1268461443
function hit()
if game:GetService("GamePassService"):PlayerHasPass(Player, ID) true then
if deb == true then return end
deb = true
local new = buf:clone()
new.Parent = game.Workspace
new:MakeJoints()
script.Parent.BrickColor = BrickColor.new(21)
wait(20)
script.Parent.BrickColor = BrickColor.new(28)
deb = false
else
game:GetService("MarketplaceService"):PromptPurchase(ITEM_ID)
end
end
script.Parent.Click.MouseClick:connect(hit)
