Advertisement
AndyWolf6610

Pepsi

Nov 20th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.85 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Sound3 = Instance.new("Sound")
  23. Sound4 = Instance.new("Sound")
  24. Sound5 = Instance.new("Sound")
  25. Script6 = Instance.new("Script")
  26. CharacterMesh7 = Instance.new("CharacterMesh")
  27. CharacterMesh8 = Instance.new("CharacterMesh")
  28. CharacterMesh9 = Instance.new("CharacterMesh")
  29. CharacterMesh10 = Instance.new("CharacterMesh")
  30. CharacterMesh11 = Instance.new("CharacterMesh")
  31. BodyColors12 = Instance.new("BodyColors")
  32. ParticleEmitter13 = Instance.new("ParticleEmitter")
  33. LocalScript14 = Instance.new("LocalScript")
  34. LocalScript15 = Instance.new("LocalScript")
  35. Animation16 = Instance.new("Animation")
  36. Tool0.Name = "Pepsi"
  37. Tool0.Parent = mas
  38. Tool0.TextureId = "http://www.roblox.com/asset/?id=101839893"
  39. Tool0.CanBeDropped = false
  40. Tool0.Grip = CFrame.new(0.0299999993, 0, 0, 0.217036352, 0, 0.976163507, 0, 1, -0, -0.976163507, 0, 0.217036352)
  41. Tool0.GripForward = Vector3.new(-0.976163507, 0, -0.217036352)
  42. Tool0.GripPos = Vector3.new(0.0299999993, 0, 0)
  43. Tool0.GripRight = Vector3.new(0.217036352, 0, -0.976163507)
  44. Tool0.ToolTip = "Satisfy your thirst with this cold ice Pepsi."
  45. Part1.Name = "Handle"
  46. Part1.Parent = Tool0
  47. Part1.CFrame = CFrame.new(8.31000042, 0.694999993, 152.369995, -0.999999523, -9.04471017e-06, 2.48451997e-05, -8.99407678e-06, 1, -1.47936089e-05, -2.47880726e-05, -1.48334029e-05, -1.00000012)
  48. Part1.Orientation = Vector3.new(0, 180, 0)
  49. Part1.Position = Vector3.new(8.31000042, 0.694999993, 152.369995)
  50. Part1.Rotation = Vector3.new(180, 0, 180)
  51. Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
  52. Part1.Size = Vector3.new(0.600000024, 1.20000005, 0.600000024)
  53. Part1.BottomSurface = Enum.SurfaceType.Smooth
  54. Part1.BrickColor = BrickColor.new("Black")
  55. Part1.Locked = true
  56. Part1.TopSurface = Enum.SurfaceType.Smooth
  57. Part1.brickColor = BrickColor.new("Black")
  58. Part1.FormFactor = Enum.FormFactor.Custom
  59. Part1.formFactor = Enum.FormFactor.Custom
  60. SpecialMesh2.Parent = Part1
  61. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=101840172"
  62. SpecialMesh2.Scale = Vector3.new(0.600000024, 0.600000024, 0.600000024)
  63. SpecialMesh2.TextureId = "rbxassetid://304687347"
  64. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  65. Sound3.Name = "Drink"
  66. Sound3.Parent = Part1
  67. Sound3.EmitterSize = 0
  68. Sound3.MinDistance = 0
  69. Sound3.SoundId = "http://www.roblox.com/asset/?id=10722059"
  70. Sound4.Name = "Open"
  71. Sound4.Parent = Part1
  72. Sound4.EmitterSize = 0
  73. Sound4.MinDistance = 0
  74. Sound4.SoundId = "http://www.roblox.com/asset/?id=10721950"
  75. Sound5.Name = "Pepsiman"
  76. Sound5.Parent = Part1
  77. Sound5.EmitterSize = 0
  78. Sound5.MinDistance = 0
  79. Sound5.SoundId = "rbxassetid://208628305"
  80. Script6.Name = "Cola"
  81. Script6.Parent = Tool0
  82. table.insert(cors,sandbox(Script6,function()
  83. ------------------------------------------------------------------------------------------------------------------------------
  84. --[[
  85. // Pepsi-Cola Tool
  86. // @SkySpell [10/09/15]
  87.  
  88. A basic replication of Pepsico's Pepsi. It also has a
  89. cool feature ;).
  90. --]]
  91. -- Variables
  92. ------------------------------------------------------------------------------------------------------------------------------
  93.  
  94. -- Services
  95. local Players = game:GetService("Players")
  96. local RbxUtil = LoadLibrary("RbxUtility")
  97. local Create = RbxUtil.Create
  98. local CProvider = game:GetService("ContentProvider")
  99.  
  100. -- Tool
  101. local Tool = script.Parent
  102. local Handle = Tool:WaitForChild("Handle")
  103.  
  104. local Sounds = {
  105. Open = { Sound = Handle:WaitForChild("Open"); Pitch = 1; Volume = 1; IsLooped = false };
  106. Drink = { Sound = Handle:WaitForChild("Drink"); Pitch = 1; Volume = 1; IsLooped = false };
  107. Pepsiman = { Sound = Handle:WaitForChild("Pepsiman"); Pitch = 1; Volume = 1; IsLooped = false }
  108. }
  109.  
  110. local Animations = {
  111. Pose = {Animation = Tool:WaitForChild("Pose"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = 5}
  112. }
  113.  
  114. ---------------------------------------------
  115.  
  116. local Content = (script:FindFirstChild("Content") or Create("Folder"){
  117. Name = "Content";
  118. Parent = script
  119. })
  120.  
  121. local PepsimanCont = (Content:FindFirstChild("Pepsiman") or Create("Folder"){
  122. Name = "Pepsiman";
  123. Parent = Content
  124. })
  125.  
  126. ---------------------------------------------
  127.  
  128. local ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
  129. Name = "ServerControl",
  130. Parent = Tool,
  131. })
  132.  
  133. local ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
  134. Name = "ClientControl",
  135. Parent = Tool,
  136. })
  137.  
  138. ---------------------------------------------
  139.  
  140. -- Script
  141. local Enabled = true
  142. local ToolEquipped = false
  143. local Pepsified = false
  144.  
  145. local Settings = {
  146. Sounds = true,
  147. Pepsiman = true,
  148. Animations = false,
  149. }
  150.  
  151. local PepsimanLib = {
  152. ---------------------------------------------
  153. Settings = {
  154. Speed = 25,
  155. Health = 1000,
  156. Jump = 100,
  157. };
  158. ---------------------------------------------
  159. Shirt = Create("Shirt"){
  160. Name = "Pepsiman_Shirt",
  161. ShirtTemplate = "http://www.roblox.com/asset/?id=192507181",
  162. Parent = PepsimanCont,
  163. };
  164.  
  165. Pants = Create("Pants"){
  166. Name = "Pepsiman_Pants",
  167. PantsTemplate = "http://www.roblox.com/asset/?id=192908520",
  168. Parent = PepsimanCont
  169. };
  170. ---------------------------------------------
  171. }
  172.  
  173. for i, charobj in pairs(script:GetChildren()) do
  174. if charobj:IsA("CharacterMesh") or charobj:IsA("BodyColors") then
  175. charobj.Parent = PepsimanCont
  176. end
  177. end
  178.  
  179. print("passed variables")
  180.  
  181. ---------------------------------------------------------------------------------------------------------------------------
  182. -- Functions
  183. ---------------------------------------------------------------------------------------------------------------------------
  184.  
  185. function InvokeClient(Mode, Value)
  186. local ClientReturn = nil
  187. pcall(function()
  188. ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
  189. end)
  190. return ClientReturn
  191. end
  192.  
  193. ServerControl.OnServerInvoke = (function(player, Mode, Value)
  194. if player ~= Player or not ToolEquipped or not Mode or not Value then
  195. return
  196. end
  197. end)
  198.  
  199. local function PlaySound(object)
  200. if object.Sound then
  201. local Sound = object.Sound
  202. Sound.Pitch = object.Pitch or 1
  203. Sound.Volume = object.Volume or .5
  204. Sound.Looped = object.IsLooped or false
  205.  
  206. Sound:Play()
  207. else
  208. warn("[SODA] Sound does not exist in the object.")
  209. return
  210. end
  211. end
  212.  
  213. local function StopSound(object)
  214. if object.Sound then
  215. local Sound = object.Sound
  216. Sound:Stop()
  217. else
  218. warn("[SODA] Sound does not exist in the object.")
  219. return
  220. end
  221. end
  222.  
  223. local function SetGrip(mode)
  224. if mode == "Drink" then
  225. Tool.GripForward = Vector3.new(0, -.759, -.651)
  226. Tool.GripPos = Vector3.new(1.5, -.5, .3)
  227. Tool.GripRight = Vector3.new(1, 0, 0)
  228. Tool.GripUp = Vector3.new(0, .651, -.759)
  229. elseif mode == "Stand" then
  230. Tool.GripForward = Vector3.new(-.976,0,-0.217)
  231. Tool.GripPos = Vector3.new(0.03,0,0)
  232. Tool.GripRight = Vector3.new(.217,0,-.976)
  233. Tool.GripUp = Vector3.new(0,1,0)
  234. else
  235. warn("[SODA] The value that the function 'SetGrip' is set to is not valid.")
  236. return
  237. end
  238. end
  239.  
  240. local function SetSpeed(mode, customvalue)
  241. if mode == "Run" then
  242. Humanoid.WalkSpeed = PepsimanLib.Settings.Speed
  243. elseif mode == "Walk" then
  244. Humanoid.WalkSpeed = 16
  245. elseif mode == "Custom" and customvalue then -- IN CASE I WANT TO.
  246. Humanoid.WalkSpeed = customvalue
  247. else
  248. warn("[SODA] The value that the function 'SetSpeed' is set to is not valid.")
  249. return
  250. end
  251. end
  252.  
  253. local function ForceExplosion()
  254. local Explosion = Create("Explosion"){
  255. Name = "Pepsiman_EXPLOSION",
  256. Parent = Torso,
  257. BlastRadius = 10,
  258. BlastPressure = 0,
  259. ExplosionType = Enum.ExplosionType.NoCraters,
  260. DestroyJointRadiusPercent = 0,
  261. Position = Torso.Position
  262. }
  263. return Explosion
  264. end
  265.  
  266. local function Pepsify()
  267. if not Pepsified then
  268. local EmitClone = script.ParticleEmitter:Clone()
  269. EmitClone.Parent = Torso
  270. EmitClone.Enabled = true
  271. wait(5)
  272. --
  273. ForceExplosion()
  274. EmitClone:Destroy()
  275. InvokeClient("PlayAnimation", Animations.Pose)
  276. --
  277. for i, oldobj in pairs(Character:GetChildren()) do
  278. if oldobj:IsA("Shirt") or oldobj:IsA("Pants") or oldobj:IsA("ShirtGraphic") or oldobj:IsA("CharacterMesh")
  279. or oldobj:IsA("Hat") or oldobj:IsA("BodyColors") then
  280. oldobj:Destroy()
  281. end
  282. end
  283. --
  284. for i, oldheadobj in pairs(Head:GetChildren()) do
  285. if oldheadobj:IsA("Decal") then
  286. oldheadobj:Destroy()
  287. end
  288. end
  289. --
  290. for i, newobj in pairs(PepsimanCont:GetChildren()) do
  291. local newclone = newobj:Clone()
  292. newclone.Parent = Character
  293. end
  294. --
  295. PlaySound(Sounds.Pepsiman)
  296. --
  297. SetSpeed("Run")
  298. --
  299. Pepsified = true
  300. end
  301. end
  302.  
  303. local function Activation()
  304. if Enabled and ToolEquipped then
  305. Enabled = false
  306. PlaySound(Sounds.Drink)
  307. SetGrip("Drink")
  308. --
  309. wait(2)
  310. --
  311. SetGrip("Stand")
  312. --
  313. if Settings.Pepsiman == true and not Pepsified then
  314. Pepsify()
  315. end
  316. --
  317. Enabled = true
  318. end
  319. end
  320.  
  321. ---------------------------------------------------------------------------------------------------------------------------
  322. -- Tool Logic
  323. ---------------------------------------------------------------------------------------------------------------------------
  324.  
  325. Tool.Equipped:connect(function()
  326. ToolEquipped = true
  327. Character = Tool.Parent
  328. Head = Character:WaitForChild("Head")
  329. Humanoid = Character:WaitForChild("Humanoid")
  330. Torso = Character:WaitForChild("Torso")
  331. Player = Players:GetPlayerFromCharacter(Character)
  332.  
  333. InvokeClient("Preload", Tool.Pose.AnimationId)
  334. PlaySound(Sounds.Open)
  335. end)
  336.  
  337. script.Parent.Unequipped:connect(function()
  338. ToolEquipped = false
  339. --
  340. for i, v in pairs(Sounds) do
  341. if v.Sound then
  342. StopSound(v)
  343. end
  344. end
  345. --
  346. end)
  347.  
  348. Tool.Activated:connect(Activation)
  349. end))
  350. CharacterMesh7.Name = "Left_Arm"
  351. CharacterMesh7.Parent = Script6
  352. CharacterMesh7.BodyPart = Enum.BodyPart.LeftArm
  353. CharacterMesh7.MeshId = 32328397
  354. CharacterMesh8.Name = "Left_Leg"
  355. CharacterMesh8.Parent = Script6
  356. CharacterMesh8.BodyPart = Enum.BodyPart.LeftLeg
  357. CharacterMesh8.MeshId = 32328520
  358. CharacterMesh9.Name = "Right_Arm"
  359. CharacterMesh9.Parent = Script6
  360. CharacterMesh9.BodyPart = Enum.BodyPart.RightArm
  361. CharacterMesh9.MeshId = 32328563
  362. CharacterMesh10.Name = "Right_Leg"
  363. CharacterMesh10.Parent = Script6
  364. CharacterMesh10.BodyPart = Enum.BodyPart.RightLeg
  365. CharacterMesh10.MeshId = 32328627
  366. CharacterMesh11.Name = "Torso"
  367. CharacterMesh11.Parent = Script6
  368. CharacterMesh11.BodyPart = Enum.BodyPart.Torso
  369. CharacterMesh11.MeshId = 32328670
  370. BodyColors12.Parent = Script6
  371. BodyColors12.HeadColor = BrickColor.new("Institutional white")
  372. BodyColors12.HeadColor3 = Color3.new(0.972549, 0.972549, 0.972549)
  373. BodyColors12.LeftArmColor = BrickColor.new("Institutional white")
  374. BodyColors12.LeftArmColor3 = Color3.new(0.972549, 0.972549, 0.972549)
  375. BodyColors12.LeftLegColor = BrickColor.new("Institutional white")
  376. BodyColors12.LeftLegColor3 = Color3.new(0.972549, 0.972549, 0.972549)
  377. BodyColors12.RightArmColor = BrickColor.new("Institutional white")
  378. BodyColors12.RightArmColor3 = Color3.new(0.972549, 0.972549, 0.972549)
  379. BodyColors12.RightLegColor = BrickColor.new("Really blue")
  380. BodyColors12.RightLegColor3 = Color3.new(0, 0, 1)
  381. BodyColors12.TorsoColor = BrickColor.new("Institutional white")
  382. BodyColors12.TorsoColor3 = Color3.new(0.972549, 0.972549, 0.972549)
  383. ParticleEmitter13.Parent = Script6
  384. ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.835294, 0, 0),Color3.new(0.270588, 0, 0.815686))
  385. ParticleEmitter13.Enabled = false
  386. ParticleEmitter13.LightEmission = 1
  387. ParticleEmitter13.Transparency = NumberSequence.new(0,0,0.23333328962326)
  388. ParticleEmitter13.Size = NumberSequence.new(0,1.3124996423721,0)
  389. ParticleEmitter13.Lifetime = NumberRange.new(0.10000000149012, 1)
  390. ParticleEmitter13.LockedToPart = true
  391. ParticleEmitter13.Rate = 10
  392. ParticleEmitter13.SpreadAngle = Vector2.new(-50, -50)
  393. ParticleEmitter13.VelocitySpread = -50
  394. LocalScript14.Name = "Client"
  395. LocalScript14.Parent = Tool0
  396. table.insert(cors,sandbox(LocalScript14,function()
  397. ---------------------------------------------------------------------------------------------------------------------------
  398. -- Credits to @LuckyMaxer for this.
  399. -- Variables
  400. ---------------------------------------------------------------------------------------------------------------------------
  401.  
  402. -- Services
  403. local Players = game:GetService("Players")
  404. local ContentProvider = game:GetService("ContentProvider")
  405.  
  406. -- Tool
  407. local Tool = script.Parent
  408. local Handle = Tool:WaitForChild("Handle")
  409.  
  410. local Animations = {}
  411.  
  412. local ServerControl = Tool:WaitForChild("ServerControl")
  413. local ClientControl = Tool:WaitForChild("ClientControl")
  414.  
  415. ---------------------------------------------------------------------------------------------------------------------------
  416. -- Functions
  417. ---------------------------------------------------------------------------------------------------------------------------
  418.  
  419. ClientControl.OnClientInvoke = (function(Mode, Value)
  420. if Mode == "PlayAnimation" and Humanoid then
  421. for i, v in pairs(Animations) do
  422. if v.Animation == Value.Animation then
  423. v.AnimationTrack:Stop()
  424. table.remove(Animations, i)
  425. end
  426. end
  427. local AnimationTrack = Humanoid:LoadAnimation(Value.Animation)
  428. table.insert(Animations, {Animation = Value.Animation, AnimationTrack = AnimationTrack})
  429. AnimationTrack:Play(Value.FadeTime, Value.Weight, Value.Speed)
  430. elseif Mode == "StopAnimation" and Value then
  431. for i, v in pairs(Animations) do
  432. if v.Animation == Value.Animation then
  433. v.AnimationTrack:Stop()
  434. table.remove(Animations, i)
  435. end
  436. end
  437. elseif Mode == "Preload" and Value then
  438. ContentProvider:Preload(Value)
  439. elseif Mode == "PlaySound" and Value then
  440. Value:Play()
  441. elseif Mode == "StopSound" and Value then
  442. Value:Stop()
  443. elseif Mode == "MousePosition" then
  444. return PlayerMouse.Hit.p
  445. end
  446. end)
  447.  
  448. function InvokeServer(Mode, Value)
  449. pcall(function()
  450. local ServerReturn = ServerControl:InvokeServer(Mode, Value)
  451. return ServerReturn
  452. end)
  453. end
  454.  
  455. function CheckIfAlive()
  456. return (Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0)
  457. end
  458.  
  459. function Equipped(Mouse)
  460. Character = Tool.Parent
  461. Player = Players:GetPlayerFromCharacter(Character)
  462. Humanoid = Character:FindFirstChild("Humanoid")
  463. if not CheckIfAlive() then
  464. return
  465. end
  466. PlayerMouse = Player:GetMouse()
  467. Mouse.Button1Down:connect(function()
  468. InvokeServer("MouseClick", {Down = true})
  469. end)
  470. Mouse.Button1Up:connect(function()
  471. InvokeServer("MouseClick", {Down = false})
  472. end)
  473. Mouse.KeyDown:connect(function(Key)
  474. InvokeServer("KeyPress", {Key = Key, Down = true})
  475. end)
  476. Mouse.KeyUp:connect(function(Key)
  477. InvokeServer("KeyPress", {Key = Key, Down = false})
  478. end)
  479. end
  480.  
  481. function Unequipped()
  482. for i, v in pairs(Animations) do
  483. if v and v.AnimationTrack then
  484. v.AnimationTrack:Stop()
  485. end
  486. end
  487. Animations = {}
  488. end
  489.  
  490. Tool.Equipped:connect(Equipped)
  491. Tool.Unequipped:connect(Unequipped)
  492. end))
  493. LocalScript15.Name = "Mouse"
  494. LocalScript15.Parent = Tool0
  495. table.insert(cors,sandbox(LocalScript15,function()
  496. ---------------------------------------------------------------------------------------------------------------------------
  497. -- @LuckyMaxer 2015
  498. -- Variables
  499. ---------------------------------------------------------------------------------------------------------------------------
  500.  
  501. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  502. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  503.  
  504. Tool = script.Parent
  505.  
  506. Mouse = nil
  507.  
  508. ---------------------------------------------------------------------------------------------------------------------------
  509. -- Functions
  510. ---------------------------------------------------------------------------------------------------------------------------
  511.  
  512. function UpdateIcon()
  513. if Mouse then
  514. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  515. end
  516. end
  517.  
  518. function OnEquipped(ToolMouse)
  519. Mouse = ToolMouse
  520. UpdateIcon()
  521. end
  522.  
  523. function OnChanged(Property)
  524. if Property == "Enabled" then
  525. UpdateIcon()
  526. end
  527. end
  528.  
  529. Tool.Equipped:connect(OnEquipped)
  530. Tool.Changed:connect(OnChanged)
  531.  
  532. end))
  533. Animation16.Name = "Pose"
  534. Animation16.Parent = Tool0
  535. Animation16.AnimationId = "http://www.roblox.com/Asset?ID=304693268"
  536. for i,v in pairs(mas:GetChildren()) do
  537. v.Parent = workspace
  538. pcall(function() v:MakeJoints() end)
  539. end
  540. mas:Destroy()
  541. for i,v in pairs(cors) do
  542. spawn(function()
  543. pcall(v)
  544. end)
  545. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement