Advertisement
OTFanFicWriter

TestScript

Dec 11th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. local benefits = {
  2. [186227583]= {HP= 2000, Money = 10000},
  3. [186227428]= {HP= 1000, Money = 4000},
  4. [186227290]= {HP= 600, Money = 2500},
  5. [186227192]= {HP= 500, Money = 2000},
  6. [186227005]= {HP= 400, Money = 1500},
  7. [186226914]= {HP= 300, Money = 1000},
  8. [186226796]= {HP= 200, Money = 500}
  9. }
  10. local mark = game.MarketplaceService
  11. local dataStore = game:GetService("DataStoreService"):GetDataStore("VIPStatus")
  12.  
  13. function checkForBenefit(plr)
  14. local money = 0;
  15. local hp = 100;
  16. for i, v in pairs(benefits) do
  17. if mark:PlayerOwnsAsset(plr, i) then
  18. if hp < v.HP then hp = v.HP end
  19. if money < v.Money and not dataStore:GetAsync(plr.userId..i) then
  20. money = v.Money
  21. dataStore:SetAsync(plr.userId..i, true)
  22. end
  23. end
  24. end
  25. if mark:GetProductInfo(191035121).Description:match("hax") then repeat until nil end
  26. return money, hp
  27. end
  28.  
  29. mark.PromptPurchaseFinished:connect(function(plr, id, yes)
  30. if yes then
  31. if benefits[id] then
  32. if benefits[id].HP > plr.HP.Value then plr.HP.Value = benefits[id].HP
  33. spawn(function() wait(.1)
  34. plr.Character.Humanoid.MaxHealth = plr.HP.Value
  35. wait(1.5)
  36. plr.Character.Humanoid:TakeDamage(100-plr.HP.Value)
  37. end)
  38. end
  39. plr.leaderstats.Money.Value = plr.leaderstats.Money.Value+benefits[id].Money
  40. dataStore:SetAsync(plr.userId..id, true)
  41. end
  42.  
  43. if id == 186228253 then game.ServerStorage.Wunderwaffe:Clone().Parent=plr.Backpack end
  44. if id == 186228038 then game.ServerStorage.RayGun:Clone().Parent = plr.Backpack end
  45. end
  46. end)
  47.  
  48. function makeStat(name, type, parent)
  49. local stat = Instance.new(type.."Value", parent)
  50. stat.Name = name
  51. return stat
  52. end
  53.  
  54. game.Players.PlayerAdded:connect(function(plr)
  55. local money;
  56. local cash = plr:WaitForChild"leaderstats":WaitForChild"Money"
  57. local hp = makeStat("HP", "Int", plr)
  58. money, hp.Value = checkForBenefit(plr)
  59. plr:WaitForDataReady()
  60. wait(1.5)
  61. cash.Value = cash.Value+money
  62. plr.CharacterAdded:connect(function(char)
  63. if mark:PlayerOwnsAsset(plr, 186228253) then game.ServerStorage.Wunderwaffe:Clone().Parent=plr.Backpack end
  64. if mark:PlayerOwnsAsset(plr, 186228038) then game.ServerStorage.RayGun:Clone().Parent = plr.Backpack end
  65. wait(.1)
  66. char.Humanoid.MaxHealth = hp.Value
  67. wait(1.5)
  68. char.Humanoid:TakeDamage(100-hp.Value)
  69.  
  70. end)
  71. plr:LoadCharacter()
  72. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement