Guest User

Untitled

a guest
Sep 7th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. local m9button = ScreenGui:WaitForChild("Frame").m9button.BUY --change this to wherever the button is located
  2. script.Parent.Frame.m9button.BUY.Text = 'BUY - 500$P'
  3. m9button.MouseButton1Click:Connect(function()
  4.     local amount = 500
  5.     if Player.Backpack:FindFirstChild('M9') or Player.Character:FindFirstChild('M9') then      
  6.             costText.Text = 'You have already bought this item!'
  7.             wait(3)
  8.             costText.Text = ''
  9.     else
  10.         if Player.leaderstats.Points.Value >= amount then
  11.             ToolPurchase:FireServer("M9", Player.Backpack.Inventory.HasM9, amount) --for the second argument just remove the value
  12.         else
  13.             local pointsrequired = amount - currency.Value
  14.             costText.Text = 'You need '..pointsrequired..' more Party Points to buy this item!'
  15.             wait(2)
  16.             costText.Text = ''
  17.         end
  18.     end
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment