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

How do I go about making the script stop after a X amount of seconds? [closed]

Asked by 7 years ago
Edited 7 years ago

Main Script

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


local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Coin = ReplicatedStorage:WaitForChild('Coin')
local DropperPart = script.Parent
local Spawn = script.Parent.Parent.SpawnTime.Value
script.Parent.Transparency = 1
while wait(Spawn) do
local NewCoin = Coin:Clone()
NewCoin.Parent = DropperPart
NewCoin.CFrame = DropperPart.CFrame
game:GetService('Debris'):AddItem(NewCoin,Spawn)


end
end)

Gui Script

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.Main.FrenzyStart:FireServer()
    end
    return Enum.ProductPurchaseDecision.PurchaseGranted
    end
0
Wut? DrPredablox 153 — 7y
0
Try stating your problem. thesit123 509 — 7y

Closed as Too Broad by H4X0MSYT, abnotaddable, thesit123, Void_Frost, and IcyEvil

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?