local id1 = 19453079
local id2 = 20607058
plr = script.Parent.Parent.Parent
local aree = os.time
script.Parent.f.b.MouseButton1Click:connect(function()
g = game:GetService("MarketplaceService")
g:PromptProductPurchase(plr, idone)
end)
script.Parent.f.ar.MouseButton1Click:connect(function()
DataStore = game:GetService("DataStoreService"):GetGlobalDataStore(shoplistaer)
local a=DataStore:GetAsync("user_"..plr.userId)
if a then
if a >= aree then
for i, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Sound") then v:Destroy() end end
local pitch = 1
local id = script.Parent.f.ss
local s = Instance.new("Sound", game.Workspace) s.SoundId = "http://www.roblox.com/asset/?id=" .. id.Value s.Volume = 1 s.Pitch = pitch s.Looped = true s.archivable = false repeat s:Play() wait(2.5) s:Stop() wait(.5) s:Play() until s.IsPlaying
elseif a <= aree then
g = game:GetService("MarketplaceService")
g:PromptProductPurchase(plr, id2)
end
else
DataStore:SetAsync("user_"..plr.userId, 0)
g = game:GetService("MarketplaceService")
g:PromptProductPurchase(plr, id2)
end
end)
This is the fixed version i've made:
local idone = 19453079
local idtwo = 20607058
plr = script.Parent.Parent.Parent
local aree = os.time()
function itWasClickedOMG()
g = game:GetService("MarketplaceService")
g:PromptProductPurchase(plr, idone)
end
script.Parent.f.ar.MouseButton1Click:connect(function()
DataStore = game:GetService("DataStoreService"):GetGlobalDataStore(shoplistaer)
local a=DataStore:GetAsync("user_"..plr.userId)
if a then
if tonumber(a.keyvalue) >= tonumber(aree) then
for i, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Sound") then v:Destroy() end end
local pitch = 1
local id = script.Parent.f.ss
local s = Instance.new("Sound", game.Workspace) s.SoundId = "http://www.roblox.com/asset/?id=" .. id.Value s.Volume = 1 s.Pitch = pitch s.Looped = true s.archivable = false repeat s:Play() wait(2.5) s:Stop() wait(.5) s:Play() until s.IsPlaying
elseif a <= aree then
g = game:GetService("MarketplaceService")
g:PromptProductPurchase(plr, idtwo)
end
else
DataStore:SetAsync("user_"..plr.userId, 0)
g = game:GetService("MarketplaceService")
g:PromptProductPurchase(plr, idtwo)
end
end)
script.Parent.f.b.MouseButton1Click:connect(itWasClickedOMG)
Hope this helped!
Thanks,
marcoantoniosantos3
1 comment