Advertisement
Guest User

gravity coil button

a guest
Dec 9th, 2016
2,576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local replicatedstorage = game:GetService('ReplicatedStorage')
  3. script.Parent.MouseButton1Click:connect(function()
  4. if plr.Backpack:FindFirstChild('GravityCoil') or plr.StarterGear:FindFirstChild('GravityCoil') or game.Workspace[plr.Name]:FindFirstChild('GravityCoil') then
  5. script.Parent.Parent.TextLabel.Text = 'You have already bought this item!'
  6. wait(3)
  7. script.Parent.Parent.TextLabel.Text = 'Welcome to my shop'
  8. else
  9. if plr.leaderstats.Points.Value >= 30 then
  10. replicatedstorage.GravityCoil:Clone().Parent = plr.Backpack
  11. replicatedstorage.GravityCoil:Clone().Parent = plr.StarterGear
  12. else --
  13. local cashrequired = 30 - plr.leaderstats.Points.Value
  14. script.Parent.Parent.TextLabel.Text = 'You need '..cashrequired..' more money to buy this item!'
  15. wait(3)
  16. script.Parent.Parent.TextLabel.Text = 'Welcome to my shop'
  17. end
  18.  
  19. end
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement