Hello Developers!
I am creating a Nuke System.
I have a gui and you click on it and a purchaseprompt pops up.
When the transaction suceeds, the nuke announcement pops up and the screen shakes and everyone dies.
However, when you repeat this process again, it doesn’t work!
Can someone help me? Thanks!
NukeButtonGui LocalScript:
local Id = 1250490905
local MPS = game:GetService("MarketplaceService")
local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
MPS:PromptProductPurchase(Player, Id)
end)
Serverscript Script NukeSystem:
local market = game:GetService("MarketplaceService")
market.ProcessReceipt = function(ReciptInfo)
if ReciptInfo.ProductId == 1250330224 then
local player = game.Players:GetPlayerByUserId(ReciptInfo.PlayerId)
game.ReplicatedStorage.RemoteEvent:FireAllClients(player)
game.ReplicatedStorage.GUI:FireAllClients(player)
local ShakeEvent = game.ReplicatedStorage:WaitForChild("ShakeEvent")
ShakeEvent:FireAllClients(5)
wait(5)
for i,v in pairs(game.Players:GetPlayers()) do
if v:IsA("Player") then
local char = v.Character
char.Humanoid.Health = 0
end
end
wait(2)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
Announcement GUI Local Script:
game.ReplicatedStorage.GUI.OnClientEvent:Connect(function()
script.Parent.Parent.Enabled = true
script.Parent.Text = "A"
wait(0.1)
script.Parent.Text = "A "
wait(0.1)
script.Parent.Text = "A N"
wait(0.1)
script.Parent.Text = "A NU"
wait(0.1)
script.Parent.Text = "A NUK"
wait(0.1)
script.Parent.Text = "A NUKE"
wait(0.1)
script.Parent.Text = "A NUKE "
wait(0.1)
script.Parent.Text = "A NUKE H"
wait(0.1)
script.Parent.Text = "A NUKE HA"
wait(0.1)
script.Parent.Text = "A NUKE HAS"
wait(0.1)
script.Parent.Text = "A NUKE HAS "
wait(0.1)
script.Parent.Text = "A NUKE HAS B"
wait(0.1)
script.Parent.Text = "A NUKE HAS BE"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEE"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN "
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN L"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN LA"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN LAU"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN LAUN"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN LAUNC"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN LAUNCHE"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN LAUNCHED"
wait(0.1)
script.Parent.Text = "A NUKE HAS BEEN LAUNCHED!"
wait(3)
script.Parent.Parent.Enabled = false
end)