Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. local buyItem = script:WaitForChild("BuyItem")
  2. function buyItem.OnServerInvoke(plr,item,cost,method)
  3. local plrData = game.ReplicatedStorage:WaitForChild("MoneyData"):WaitForChild(plr.Name)
  4.  
  5. local a = require(game.ServerScriptService.UTAPI2)
  6. local bid = a:GetBoardID("Mano County Ban List")
  7. local lid = a:GetListID("Banlist",bid)
  8.  
  9. if method == "Cash" then
  10. if cost ~= game.ServerStorage.StoreItems:FindFirstChild(item.."Price").Value then
  11. local AddBan = a:AddCard(plr.Name .. ":"..plr.UserId,"**[ANTI-EXPLOIT] AUTOMATIC BAN SYSTEM**" .. "\
  12. ".."**" .. plr.Name .."**".. " has been banned for trying to use a dealer exploit." .. "\
  13. " .."".. "\
  14. ".."-----".."\
  15. ".."Scripted By: phSalami",lid,nil,"bottom","null","purple") --,nil,"bottom","null","purple"
  16. plr:Kick("[TRELLO BAN] Ouch, that was an old dealer exploit.")
  17. else
  18. local cash = plrData:WaitForChild("Cash")
  19. if cash.Value >= cost then
  20. local itemClone = game.ServerStorage.StoreItems:FindFirstChild(item):Clone()
  21. itemClone.Parent = plr.Backpack
  22. cash.Value = cash.Value - cost
  23. return true
  24. else
  25. return false
  26. end
  27. end
  28. elseif method == "BankAccount" or method == "Credit" then
  29. if cost ~= game.ServerStorage.StoreItems:FindFirstChild(item.."Price").Value then
  30. local AddBan = a:AddCard(plr.Name .. ":"..plr.UserId,"**[ANTI-EXPLOIT] AUTOMATIC BAN SYSTEM**" .. "\
  31. ".."**" .. plr.Name .."**".. " has been banned for trying to use a dealer exploit." .. "\
  32. " .."".. "\
  33. ".."-----".."\
  34. ".."Scripted By: phSalami",lid,nil,"bottom","null","purple") --,nil,"bottom","null","purple"
  35. plr:Kick("[TRELLO BAN] Ouch, that was an old dealer exploit.")
  36. else
  37. local BankAccount = plrData:WaitForChild("BankAccount")
  38. if BankAccount.Value >= cost then
  39. local itemClone = game.ServerStorage.StoreItems:FindFirstChild(item):Clone()
  40. itemClone.Parent = plr.Backpack
  41. BankAccount.Value = BankAccount.Value - cost
  42. return true
  43. else
  44. return false
  45. end
  46. end
  47.  
  48. elseif method == "GuiDestroy" then
  49. if item.ClassName == "ScreenGui" and item.Parent.Parent == plr then
  50. item:Destroy()
  51. end
  52. end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement