Advertisement
Guest User

Untitled

a guest
May 25th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.87 KB | None | 0 0
  1. function ENT:AcceptInput(name, activator, caller)
  2. if (!self.nextUse or CurTime() >= self.nextUse) then
  3. if (name == "Use" and caller:IsPlayer()) then
  4. if (caller:GetNWInt("melon")>0) or (caller:GetNWInt("cabbage")>0) or (caller:GetNWInt("watermelon")>0) or (caller:GetNWInt("tomato")>0) or (caller:GetNWInt("orange")>0) or
  5. (caller:GetNWInt("apple")>0) or (caller:GetNWInt("lemon")>0) or (caller:GetNWInt("potato")>0) then
  6. caller:SendLua("local tab={Color(255,255,255),[[Hello ]],Color(0,75,255),[["..caller:Nick().."]],Color(255,255,255),[[!]]}chat.AddText(unpack(tab))");
  7. self:EmitSound("vo/npc/male01/nice.wav", 70, 100);
  8. local totalAmount = 0;
  9. if (caller:GetNWInt("melon")>0) then
  10. local money = math.Round(caller:GetNWInt("melon")*FS_Melon_Price);
  11. totalAmount = totalAmount + money;
  12. if (GAMEMODE.Version == "2.5.1") then
  13. caller:addMoney(money);
  14. elseif (GAMEMODE.Version == "2.4.3") then
  15. caller:AddMoney(money);
  16. end;
  17. if (caller:GetNWInt("melon") > 1) then
  18. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(213,213,25),[["..caller:GetNWInt("melon").." Melons]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  19. elseif (caller:GetNWInt("melon") == 1) then
  20. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(213,213,25),[["..caller:GetNWInt("melon").." Melon]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  21. end;
  22. caller:SetNWInt("melon", 0);
  23. end;
  24. if (caller:GetNWInt("cabbage")>0) then
  25. local money = math.Round(caller:GetNWInt("cabbage")*FS_Cabbage_Price);
  26. totalAmount = totalAmount + money;
  27. if (GAMEMODE.Version == "2.5.1") then
  28. caller:addMoney(money);
  29. elseif (GAMEMODE.Version == "2.4.3") then
  30. caller:AddMoney(money);
  31. end;
  32. if (caller:GetNWInt("cabbage") > 1) then
  33. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(177,222,160),[["..caller:GetNWInt("cabbage").." Cabbages]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  34. elseif (caller:GetNWInt("cabbage") == 1) then
  35. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(177,222,160),[["..caller:GetNWInt("cabbage").." Cabbage]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  36. end;
  37. caller:SetNWInt("cabbage", 0);
  38. end;
  39. if (caller:GetNWInt("watermelon")>0) then
  40. local money = math.Round(caller:GetNWInt("watermelon")*FS_Watermelon_Price);
  41. totalAmount = totalAmount + money;
  42. if (GAMEMODE.Version == "2.5.1") then
  43. caller:addMoney(money);
  44. elseif (GAMEMODE.Version == "2.4.3") then
  45. caller:AddMoney(money);
  46. end;
  47. if (caller:GetNWInt("watermelon") > 1) then
  48. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(119,214,25),[["..caller:GetNWInt("watermelon").." Watermelons]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  49. elseif (caller:GetNWInt("watermelon") == 1) then
  50. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(119,214,25),[["..caller:GetNWInt("watermelon").." Watermelon]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  51. end;
  52. caller:SetNWInt("watermelon", 0);
  53. end;
  54. if (caller:GetNWInt("tomato")>0) then
  55. local money = math.Round(caller:GetNWInt("tomato")*FS_Tomato_Price);
  56. totalAmount = totalAmount + money;
  57. if (GAMEMODE.Version == "2.5.1") then
  58. caller:addMoney(money);
  59. elseif (GAMEMODE.Version == "2.4.3") then
  60. caller:AddMoney(money);
  61. end;
  62. if (caller:GetNWInt("tomato") > 1) then
  63. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(175,0,0),[["..caller:GetNWInt("tomato").." Tomatoes]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  64. elseif (caller:GetNWInt("tomato") == 1) then
  65. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(175,0,0),[["..caller:GetNWInt("tomato").." Tomato]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  66. end;
  67. caller:SetNWInt("tomato", 0);
  68. end;
  69. if (caller:GetNWInt("orange")>0) then
  70. local money = math.Round(caller:GetNWInt("orange")*FS_Orange_Price);
  71. totalAmount = totalAmount + money;
  72. if (GAMEMODE.Version == "2.5.1") then
  73. caller:addMoney(money);
  74. elseif (GAMEMODE.Version == "2.4.3") then
  75. caller:AddMoney(money);
  76. end;
  77. if (caller:GetNWInt("orange") > 1) then
  78. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(246,165,42),[["..caller:GetNWInt("orange").." Oranges]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  79. elseif (caller:GetNWInt("orange") == 1) then
  80. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(246,165,42),[["..caller:GetNWInt("orange").." Orange]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  81. end;
  82. caller:SetNWInt("orange", 0);
  83. end;
  84. if (caller:GetNWInt("apple")>0) then
  85. local money = math.Round(caller:GetNWInt("apple")*FS_Apple_Price);
  86. totalAmount = totalAmount + money;
  87. if (GAMEMODE.Version == "2.5.1") then
  88. caller:addMoney(money);
  89. elseif (GAMEMODE.Version == "2.4.3") then
  90. caller:AddMoney(money);
  91. end;
  92. if (caller:GetNWInt("apple") > 1) then
  93. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(138,239,95),[["..caller:GetNWInt("apple").." Apples]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  94. elseif (caller:GetNWInt("apple") == 1) then
  95. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(138,239,95),[["..caller:GetNWInt("apple").." Apple]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  96. end;
  97. caller:SetNWInt("apple", 0);
  98. end;
  99. if (caller:GetNWInt("lemon")>0) then
  100. local money = math.Round(caller:GetNWInt("lemon")*FS_Lemon_Price);
  101. totalAmount = totalAmount + money;
  102. if (GAMEMODE.Version == "2.5.1") then
  103. caller:addMoney(money);
  104. elseif (GAMEMODE.Version == "2.4.3") then
  105. caller:AddMoney(money);
  106. end;
  107. if (caller:GetNWInt("lemon") > 1) then
  108. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(225,255,0),[["..caller:GetNWInt("lemon").." Lemons]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  109. elseif (caller:GetNWInt("lemon") == 1) then
  110. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(225,255,0),[["..caller:GetNWInt("lemon").." Lemon]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  111. end;
  112. caller:SetNWInt("lemon", 0);
  113. end;
  114. if (caller:GetNWInt("potato")>0) then
  115. local money = math.Round(caller:GetNWInt("potato")*FS_Potato_Price);
  116. totalAmount = totalAmount + money;
  117. if (GAMEMODE.Version == "2.5.1") then
  118. caller:addMoney(money);
  119. elseif (GAMEMODE.Version == "2.4.3") then
  120. caller:AddMoney(money);
  121. end;
  122. if (caller:GetNWInt("potato") > 1) then
  123. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(125,82,17),[["..caller:GetNWInt("potato").." Potatoes]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  124. elseif (caller:GetNWInt("potato") == 1) then
  125. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(125,82,17),[["..caller:GetNWInt("potato").." Potato]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
  126. end;
  127. caller:SetNWInt("potato", 0);
  128. end;
  129. caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..totalAmount.."$ ]],Color(255,255,255),[[total.]]}chat.AddText(unpack(tab))");
  130. else
  131. self:EmitSound("vo/npc/male01/sorry0"..math.random(1, 3)..".wav", 70, 100);
  132. caller:SendLua("local tab={Color(255,255,255),[[You don't have anything to sell!]]}chat.AddText(unpack(tab))");
  133. end;
  134. end;
  135. self.nextUse = CurTime() + 1;
  136. end;
  137. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement