Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix this bug? Works in Studio not ingame! Tried everything I could think of

Asked by 6 years ago

Script located in FrenzyStart

local FrenzyStart = game.Workspace.CoinSpawns.CoinDropper.FrenzyStart
--script.Parent.Parent.Transparency = 1


FrenzyStart.OnServerEvent:connect(function(player)
script.Parent.Parent.Parent.DropTime.Value = 5





local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Coin = ReplicatedStorage:WaitForChild('Coin')
local CoinDropper = script.Parent.Parent
local Spawn = game.Workspace.CoinSpawns:WaitForChild("DropTime").Value
while wait(Spawn) do
local NewCoin = Coin:Clone()
NewCoin.Parent = CoinDropper
NewCoin.CFrame = CoinDropper.CFrame

script.Parent.Parent.Parent.DropTime.Value = 0

break
end
end)

Script located in ServerScriptService

local marketplaceService = game:GetService("MarketplaceService")

marketplaceService.ProcessReceipt = function(purchaseInfo)
    local plr = game:GetService("Players"):GetPlayerByUserId(purchaseInfo.PlayerId)
    if purchaseInfo.ProductId == 122550429 then
game.Workspace.CoinSpawns.CoinDropper.FrenzyStart:FireServer()

    end
    return Enum.ProductPurchaseDecision.PurchaseGranted
end

Answer this question