Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Script6 = Instance.new("Script")
- CharacterMesh7 = Instance.new("CharacterMesh")
- CharacterMesh8 = Instance.new("CharacterMesh")
- CharacterMesh9 = Instance.new("CharacterMesh")
- CharacterMesh10 = Instance.new("CharacterMesh")
- CharacterMesh11 = Instance.new("CharacterMesh")
- BodyColors12 = Instance.new("BodyColors")
- ParticleEmitter13 = Instance.new("ParticleEmitter")
- LocalScript14 = Instance.new("LocalScript")
- LocalScript15 = Instance.new("LocalScript")
- Animation16 = Instance.new("Animation")
- Tool0.Name = "Pepsi"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=101839893"
- Tool0.CanBeDropped = false
- Tool0.Grip = CFrame.new(0.0299999993, 0, 0, 0.217036352, 0, 0.976163507, 0, 1, -0, -0.976163507, 0, 0.217036352)
- Tool0.GripForward = Vector3.new(-0.976163507, 0, -0.217036352)
- Tool0.GripPos = Vector3.new(0.0299999993, 0, 0)
- Tool0.GripRight = Vector3.new(0.217036352, 0, -0.976163507)
- Tool0.ToolTip = "Satisfy your thirst with this cold ice Pepsi."
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- 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)
- Part1.Orientation = Vector3.new(0, 180, 0)
- Part1.Position = Vector3.new(8.31000042, 0.694999993, 152.369995)
- Part1.Rotation = Vector3.new(180, 0, 180)
- Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part1.Size = Vector3.new(0.600000024, 1.20000005, 0.600000024)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Black")
- Part1.Locked = true
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Black")
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.formFactor = Enum.FormFactor.Custom
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=101840172"
- SpecialMesh2.Scale = Vector3.new(0.600000024, 0.600000024, 0.600000024)
- SpecialMesh2.TextureId = "rbxassetid://304687347"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- Sound3.Name = "Drink"
- Sound3.Parent = Part1
- Sound3.EmitterSize = 0
- Sound3.MinDistance = 0
- Sound3.SoundId = "http://www.roblox.com/asset/?id=10722059"
- Sound4.Name = "Open"
- Sound4.Parent = Part1
- Sound4.EmitterSize = 0
- Sound4.MinDistance = 0
- Sound4.SoundId = "http://www.roblox.com/asset/?id=10721950"
- Sound5.Name = "Pepsiman"
- Sound5.Parent = Part1
- Sound5.EmitterSize = 0
- Sound5.MinDistance = 0
- Sound5.SoundId = "rbxassetid://208628305"
- Script6.Name = "Cola"
- Script6.Parent = Tool0
- table.insert(cors,sandbox(Script6,function()
- ------------------------------------------------------------------------------------------------------------------------------
- --[[
- // Pepsi-Cola Tool
- // @SkySpell [10/09/15]
- A basic replication of Pepsico's Pepsi. It also has a
- cool feature ;).
- --]]
- -- Variables
- ------------------------------------------------------------------------------------------------------------------------------
- -- Services
- local Players = game:GetService("Players")
- local RbxUtil = LoadLibrary("RbxUtility")
- local Create = RbxUtil.Create
- local CProvider = game:GetService("ContentProvider")
- -- Tool
- local Tool = script.Parent
- local Handle = Tool:WaitForChild("Handle")
- local Sounds = {
- Open = { Sound = Handle:WaitForChild("Open"); Pitch = 1; Volume = 1; IsLooped = false };
- Drink = { Sound = Handle:WaitForChild("Drink"); Pitch = 1; Volume = 1; IsLooped = false };
- Pepsiman = { Sound = Handle:WaitForChild("Pepsiman"); Pitch = 1; Volume = 1; IsLooped = false }
- }
- local Animations = {
- Pose = {Animation = Tool:WaitForChild("Pose"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = 5}
- }
- ---------------------------------------------
- local Content = (script:FindFirstChild("Content") or Create("Folder"){
- Name = "Content";
- Parent = script
- })
- local PepsimanCont = (Content:FindFirstChild("Pepsiman") or Create("Folder"){
- Name = "Pepsiman";
- Parent = Content
- })
- ---------------------------------------------
- local ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
- Name = "ServerControl",
- Parent = Tool,
- })
- local ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
- Name = "ClientControl",
- Parent = Tool,
- })
- ---------------------------------------------
- -- Script
- local Enabled = true
- local ToolEquipped = false
- local Pepsified = false
- local Settings = {
- Sounds = true,
- Pepsiman = true,
- Animations = false,
- }
- local PepsimanLib = {
- ---------------------------------------------
- Settings = {
- Speed = 25,
- Health = 1000,
- Jump = 100,
- };
- ---------------------------------------------
- Shirt = Create("Shirt"){
- Name = "Pepsiman_Shirt",
- ShirtTemplate = "http://www.roblox.com/asset/?id=192507181",
- Parent = PepsimanCont,
- };
- Pants = Create("Pants"){
- Name = "Pepsiman_Pants",
- PantsTemplate = "http://www.roblox.com/asset/?id=192908520",
- Parent = PepsimanCont
- };
- ---------------------------------------------
- }
- for i, charobj in pairs(script:GetChildren()) do
- if charobj:IsA("CharacterMesh") or charobj:IsA("BodyColors") then
- charobj.Parent = PepsimanCont
- end
- end
- print("passed variables")
- ---------------------------------------------------------------------------------------------------------------------------
- -- Functions
- ---------------------------------------------------------------------------------------------------------------------------
- function InvokeClient(Mode, Value)
- local ClientReturn = nil
- pcall(function()
- ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
- end)
- return ClientReturn
- end
- ServerControl.OnServerInvoke = (function(player, Mode, Value)
- if player ~= Player or not ToolEquipped or not Mode or not Value then
- return
- end
- end)
- local function PlaySound(object)
- if object.Sound then
- local Sound = object.Sound
- Sound.Pitch = object.Pitch or 1
- Sound.Volume = object.Volume or .5
- Sound.Looped = object.IsLooped or false
- Sound:Play()
- else
- warn("[SODA] Sound does not exist in the object.")
- return
- end
- end
- local function StopSound(object)
- if object.Sound then
- local Sound = object.Sound
- Sound:Stop()
- else
- warn("[SODA] Sound does not exist in the object.")
- return
- end
- end
- local function SetGrip(mode)
- if mode == "Drink" then
- Tool.GripForward = Vector3.new(0, -.759, -.651)
- Tool.GripPos = Vector3.new(1.5, -.5, .3)
- Tool.GripRight = Vector3.new(1, 0, 0)
- Tool.GripUp = Vector3.new(0, .651, -.759)
- elseif mode == "Stand" then
- Tool.GripForward = Vector3.new(-.976,0,-0.217)
- Tool.GripPos = Vector3.new(0.03,0,0)
- Tool.GripRight = Vector3.new(.217,0,-.976)
- Tool.GripUp = Vector3.new(0,1,0)
- else
- warn("[SODA] The value that the function 'SetGrip' is set to is not valid.")
- return
- end
- end
- local function SetSpeed(mode, customvalue)
- if mode == "Run" then
- Humanoid.WalkSpeed = PepsimanLib.Settings.Speed
- elseif mode == "Walk" then
- Humanoid.WalkSpeed = 16
- elseif mode == "Custom" and customvalue then -- IN CASE I WANT TO.
- Humanoid.WalkSpeed = customvalue
- else
- warn("[SODA] The value that the function 'SetSpeed' is set to is not valid.")
- return
- end
- end
- local function ForceExplosion()
- local Explosion = Create("Explosion"){
- Name = "Pepsiman_EXPLOSION",
- Parent = Torso,
- BlastRadius = 10,
- BlastPressure = 0,
- ExplosionType = Enum.ExplosionType.NoCraters,
- DestroyJointRadiusPercent = 0,
- Position = Torso.Position
- }
- return Explosion
- end
- local function Pepsify()
- if not Pepsified then
- local EmitClone = script.ParticleEmitter:Clone()
- EmitClone.Parent = Torso
- EmitClone.Enabled = true
- wait(5)
- --
- ForceExplosion()
- EmitClone:Destroy()
- InvokeClient("PlayAnimation", Animations.Pose)
- --
- for i, oldobj in pairs(Character:GetChildren()) do
- if oldobj:IsA("Shirt") or oldobj:IsA("Pants") or oldobj:IsA("ShirtGraphic") or oldobj:IsA("CharacterMesh")
- or oldobj:IsA("Hat") or oldobj:IsA("BodyColors") then
- oldobj:Destroy()
- end
- end
- --
- for i, oldheadobj in pairs(Head:GetChildren()) do
- if oldheadobj:IsA("Decal") then
- oldheadobj:Destroy()
- end
- end
- --
- for i, newobj in pairs(PepsimanCont:GetChildren()) do
- local newclone = newobj:Clone()
- newclone.Parent = Character
- end
- --
- PlaySound(Sounds.Pepsiman)
- --
- SetSpeed("Run")
- --
- Pepsified = true
- end
- end
- local function Activation()
- if Enabled and ToolEquipped then
- Enabled = false
- PlaySound(Sounds.Drink)
- SetGrip("Drink")
- --
- wait(2)
- --
- SetGrip("Stand")
- --
- if Settings.Pepsiman == true and not Pepsified then
- Pepsify()
- end
- --
- Enabled = true
- end
- end
- ---------------------------------------------------------------------------------------------------------------------------
- -- Tool Logic
- ---------------------------------------------------------------------------------------------------------------------------
- Tool.Equipped:connect(function()
- ToolEquipped = true
- Character = Tool.Parent
- Head = Character:WaitForChild("Head")
- Humanoid = Character:WaitForChild("Humanoid")
- Torso = Character:WaitForChild("Torso")
- Player = Players:GetPlayerFromCharacter(Character)
- InvokeClient("Preload", Tool.Pose.AnimationId)
- PlaySound(Sounds.Open)
- end)
- script.Parent.Unequipped:connect(function()
- ToolEquipped = false
- --
- for i, v in pairs(Sounds) do
- if v.Sound then
- StopSound(v)
- end
- end
- --
- end)
- Tool.Activated:connect(Activation)
- end))
- CharacterMesh7.Name = "Left_Arm"
- CharacterMesh7.Parent = Script6
- CharacterMesh7.BodyPart = Enum.BodyPart.LeftArm
- CharacterMesh7.MeshId = 32328397
- CharacterMesh8.Name = "Left_Leg"
- CharacterMesh8.Parent = Script6
- CharacterMesh8.BodyPart = Enum.BodyPart.LeftLeg
- CharacterMesh8.MeshId = 32328520
- CharacterMesh9.Name = "Right_Arm"
- CharacterMesh9.Parent = Script6
- CharacterMesh9.BodyPart = Enum.BodyPart.RightArm
- CharacterMesh9.MeshId = 32328563
- CharacterMesh10.Name = "Right_Leg"
- CharacterMesh10.Parent = Script6
- CharacterMesh10.BodyPart = Enum.BodyPart.RightLeg
- CharacterMesh10.MeshId = 32328627
- CharacterMesh11.Name = "Torso"
- CharacterMesh11.Parent = Script6
- CharacterMesh11.BodyPart = Enum.BodyPart.Torso
- CharacterMesh11.MeshId = 32328670
- BodyColors12.Parent = Script6
- BodyColors12.HeadColor = BrickColor.new("Institutional white")
- BodyColors12.HeadColor3 = Color3.new(0.972549, 0.972549, 0.972549)
- BodyColors12.LeftArmColor = BrickColor.new("Institutional white")
- BodyColors12.LeftArmColor3 = Color3.new(0.972549, 0.972549, 0.972549)
- BodyColors12.LeftLegColor = BrickColor.new("Institutional white")
- BodyColors12.LeftLegColor3 = Color3.new(0.972549, 0.972549, 0.972549)
- BodyColors12.RightArmColor = BrickColor.new("Institutional white")
- BodyColors12.RightArmColor3 = Color3.new(0.972549, 0.972549, 0.972549)
- BodyColors12.RightLegColor = BrickColor.new("Really blue")
- BodyColors12.RightLegColor3 = Color3.new(0, 0, 1)
- BodyColors12.TorsoColor = BrickColor.new("Institutional white")
- BodyColors12.TorsoColor3 = Color3.new(0.972549, 0.972549, 0.972549)
- ParticleEmitter13.Parent = Script6
- ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.835294, 0, 0),Color3.new(0.270588, 0, 0.815686))
- ParticleEmitter13.Enabled = false
- ParticleEmitter13.LightEmission = 1
- ParticleEmitter13.Transparency = NumberSequence.new(0,0,0.23333328962326)
- ParticleEmitter13.Size = NumberSequence.new(0,1.3124996423721,0)
- ParticleEmitter13.Lifetime = NumberRange.new(0.10000000149012, 1)
- ParticleEmitter13.LockedToPart = true
- ParticleEmitter13.Rate = 10
- ParticleEmitter13.SpreadAngle = Vector2.new(-50, -50)
- ParticleEmitter13.VelocitySpread = -50
- LocalScript14.Name = "Client"
- LocalScript14.Parent = Tool0
- table.insert(cors,sandbox(LocalScript14,function()
- ---------------------------------------------------------------------------------------------------------------------------
- -- Credits to @LuckyMaxer for this.
- -- Variables
- ---------------------------------------------------------------------------------------------------------------------------
- -- Services
- local Players = game:GetService("Players")
- local ContentProvider = game:GetService("ContentProvider")
- -- Tool
- local Tool = script.Parent
- local Handle = Tool:WaitForChild("Handle")
- local Animations = {}
- local ServerControl = Tool:WaitForChild("ServerControl")
- local ClientControl = Tool:WaitForChild("ClientControl")
- ---------------------------------------------------------------------------------------------------------------------------
- -- Functions
- ---------------------------------------------------------------------------------------------------------------------------
- ClientControl.OnClientInvoke = (function(Mode, Value)
- if Mode == "PlayAnimation" and Humanoid then
- for i, v in pairs(Animations) do
- if v.Animation == Value.Animation then
- v.AnimationTrack:Stop()
- table.remove(Animations, i)
- end
- end
- local AnimationTrack = Humanoid:LoadAnimation(Value.Animation)
- table.insert(Animations, {Animation = Value.Animation, AnimationTrack = AnimationTrack})
- AnimationTrack:Play(Value.FadeTime, Value.Weight, Value.Speed)
- elseif Mode == "StopAnimation" and Value then
- for i, v in pairs(Animations) do
- if v.Animation == Value.Animation then
- v.AnimationTrack:Stop()
- table.remove(Animations, i)
- end
- end
- elseif Mode == "Preload" and Value then
- ContentProvider:Preload(Value)
- elseif Mode == "PlaySound" and Value then
- Value:Play()
- elseif Mode == "StopSound" and Value then
- Value:Stop()
- elseif Mode == "MousePosition" then
- return PlayerMouse.Hit.p
- end
- end)
- function InvokeServer(Mode, Value)
- pcall(function()
- local ServerReturn = ServerControl:InvokeServer(Mode, Value)
- return ServerReturn
- end)
- end
- function CheckIfAlive()
- return (Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0)
- end
- function Equipped(Mouse)
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- if not CheckIfAlive() then
- return
- end
- PlayerMouse = Player:GetMouse()
- Mouse.Button1Down:connect(function()
- InvokeServer("MouseClick", {Down = true})
- end)
- Mouse.Button1Up:connect(function()
- InvokeServer("MouseClick", {Down = false})
- end)
- Mouse.KeyDown:connect(function(Key)
- InvokeServer("KeyPress", {Key = Key, Down = true})
- end)
- Mouse.KeyUp:connect(function(Key)
- InvokeServer("KeyPress", {Key = Key, Down = false})
- end)
- end
- function Unequipped()
- for i, v in pairs(Animations) do
- if v and v.AnimationTrack then
- v.AnimationTrack:Stop()
- end
- end
- Animations = {}
- end
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- end))
- LocalScript15.Name = "Mouse"
- LocalScript15.Parent = Tool0
- table.insert(cors,sandbox(LocalScript15,function()
- ---------------------------------------------------------------------------------------------------------------------------
- -- @LuckyMaxer 2015
- -- Variables
- ---------------------------------------------------------------------------------------------------------------------------
- Mouse_Icon = "rbxasset://textures/GunCursor.png"
- Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
- Tool = script.Parent
- Mouse = nil
- ---------------------------------------------------------------------------------------------------------------------------
- -- Functions
- ---------------------------------------------------------------------------------------------------------------------------
- function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
- end
- end
- function OnEquipped(ToolMouse)
- Mouse = ToolMouse
- UpdateIcon()
- end
- function OnChanged(Property)
- if Property == "Enabled" then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end))
- Animation16.Name = "Pose"
- Animation16.Parent = Tool0
- Animation16.AnimationId = "http://www.roblox.com/Asset?ID=304693268"
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement