Event in all servers

There is a game called The Impossible Obby and it has a dev product, when bought kills everyone in all servers. I have already made one for the buyer’s server using for I,player but how can I do it for all servers. The script for the dev product when bought kills everyone and takes them back 5 levels is below (the one I made):

game:GetService("MarketplaceService").ProcessReceipt = function(receiptInfo)
if (receiptInfo.ProductId == *id of product*) then
		for i, player in ipairs(game.Players:GetPlayers()) do
			wait(3)
			local text = " Has Bought The Server Troll"
			player.PlayerGui.MainGui.Trolls.Dying.LastStage.Text = p .. text
			player.PlayerGui.MainGui.Trolls.Dying:TweenPosition(UDim2.new(0.5, 0,0.5, 0),"Out","Quad",0.5,true)
				wait(3)
				player.PlayerGui.MainGui.Trolls.Dying:TweenPosition(UDim2.new(0.5, 0,-0.2, 0),"Out","Quad",0.5,true)		
				wait(0.5)
			local hum = (player.Character ~= nil) and player.Character:FindFirstChild("Humanoid") or nil
			if (hum ~= nil and player.UserId ~= receiptInfo.PlayerId) then
				local function takeback()
					for i,pla in ipairs(game.Players:GetPlayers())do
						if pla.UserId ~= receiptInfo.PlayerId then
						
							pla.leaderstats.Stage.Value = pla.leaderstats.Stage.Value - 5
							wait()
							if pla.leaderstats.Stage.Value < 0 then
								 pla.leaderstats.Stage.Value = 0
							end
								print("Player's Stage Value Minused By 5")
								
						
						
						end
						
					end
				end
				takeback()
				wait(0.5)
				hum.Health = 0
				return Enum.ProductPurchaseDecision.PurchaseGranted
			end
		end
	endif (receiptInfo.ProductId == 1028387963) then
		for i, player in ipairs(game.Players:GetPlayers()) do
			wait(3)
			local text = " Has Bought The Server Troll"
			player.PlayerGui.MainGui.Trolls.Dying.LastStage.Text = p .. text
			player.PlayerGui.MainGui.Trolls.Dying:TweenPosition(UDim2.new(0.5, 0,0.5, 0),"Out","Quad",0.5,true)
				wait(3)
				player.PlayerGui.MainGui.Trolls.Dying:TweenPosition(UDim2.new(0.5, 0,-0.2, 0),"Out","Quad",0.5,true)		
				wait(0.5)
			local hum = (player.Character ~= nil) and player.Character:FindFirstChild("Humanoid") or nil
			if (hum ~= nil and player.UserId ~= receiptInfo.PlayerId) then
				local function takeback()
					for i,pla in ipairs(game.Players:GetPlayers())do
						if pla.UserId ~= receiptInfo.PlayerId then
						
							pla.leaderstats.Stage.Value = pla.leaderstats.Stage.Value - 5
							wait()
							if pla.leaderstats.Stage.Value < 0 then
								 pla.leaderstats.Stage.Value = 0
							end
								print("Player's Stage Value Minused By 5")
								
						
						
						end
						
					end
				end
				takeback()
				wait(0.5)
				hum.Health = 0
				return Enum.ProductPurchaseDecision.PurchaseGranted
			end
		end
	end
1 Like
5 Likes

(post withdrawn by author, will be automatically deleted in 1 hour unless flagged)

1 Like