Advertisement
HowToRoblox

DonateGameClient

Mar 18th, 2022
6,557
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 1 0
  1. game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function()
  2.    
  3.     for i, descendant in pairs(workspace:GetDescendants()) do
  4.        
  5.         if descendant.Name == "StandProximityPrompt" then
  6.             descendant.Enabled = false
  7.            
  8.             descendant:GetPropertyChangedSignal("Enabled"):Connect(function()
  9.                
  10.                 descendant.Enabled = false
  11.             end)
  12.         end
  13.     end
  14. end)
  15.  
  16.  
  17. local mps = game:GetService("MarketplaceService")
  18.  
  19. for i, descendant in pairs(workspace:GetDescendants()) do
  20.    
  21.     if descendant:IsA("TextButton") and descendant:FindFirstChild("Value") and tonumber(string.sub(descendant.Text, 1, #descendant.Text-2)) then
  22.        
  23.         descendant.MouseButton1Click:Connect(function()
  24.             mps:PromptPurchase(game.Players.LocalPlayer, descendant.Value.Value)
  25.         end)
  26.     end
  27. end
  28.  
  29. workspace.DescendantAdded:Connect(function(descendant)
  30.     wait()
  31.     if descendant:IsA("TextButton") and descendant:FindFirstChild("Value") and tonumber(string.sub(descendant.Text, 1, #descendant.Text-2)) then
  32.        
  33.         descendant.MouseButton1Click:Connect(function()
  34.             mps:PromptPurchase(game.Players.LocalPlayer, descendant.Value.Value)
  35.         end)
  36.     end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement