Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Mustard Gas Grenade
- A grenade that emits airborn sulfur mustard, filling the lungs and causing the skin to bubble.
- --]] if game:GetService("RunService"):IsClient()then error("say h/ not hl/")end;print("LOADING... 99%");InternalData = {}
- do
- script.Parent = owner.Character
- local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
- local function NewFakeEvent()
- local Bind = Instance.new("BindableEvent")
- local Fake;Fake = {Connections = {},
- fakeEvent=true;
- Connect=function(self,Func)
- Bind.Event:connect(Func)
- self.Connections[Bind] = true
- return setmetatable({Connected = true},{
- __index = function (self,Index)
- if Index:lower() == "disconnect" then
- return function() Fake.Connections[Bind] = false;self.Connected = false end
- end
- return Fake[Index]
- end;
- __tostring = function() return "Connection" end;
- })
- end}
- Fake.connect = Fake.Connect;return Fake;
- end
- local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
- local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
- local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
- self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
- end};ContextActionService.UnBindAction = ContextActionService.BindAction
- local function TriggerEvent(self,Event,...)
- local Trigger = Mouse[Event]
- if Trigger and Trigger.fakeEvent and Trigger.Connections then
- for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
- end
- end
- Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
- Event.OnServerEvent:Connect(function(FiredBy,Input)
- if FiredBy.Name ~= owner.Name then return end
- if Input.MouseEvent then
- Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
- else
- local Begin = Input.UserInputState == Enum.UserInputState.Begin
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
- for _,Action in pairs(ContextActionService.Actions) do
- for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
- end
- Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
- UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
- end
- end)
- InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
- Event.Parent = NLS([[
- local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
- local Input = function(Input,gameProcessedEvent)
- if gameProcessedEvent then return end
- Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
- end
- UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
- local Hit,Target
- while wait(1/30) do
- if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
- Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
- end
- end
- ]],owner.Character)
- end
- RealGame = game;game = setmetatable({},{
- __index = function (self,Index)
- local Sandbox = function (Thing)
- if Thing:IsA("Player") then
- local RealPlayer = Thing
- return setmetatable({},{
- __index = function (self,Index)
- local Type = type(RealPlayer[Index])
- if Type == "function" then
- if Index:lower() == "getmouse" or Index:lower() == "mouse" then
- return function (self)return InternalData["Mouse"] end
- end
- return function (self,...)return RealPlayer[Index](RealPlayer,...) end
- end
- return RealPlayer[Index]
- end;
- __tostring = function(self) return RealPlayer.Name end
- })
- end
- end
- if RealGame[Index] then
- local Type = type(RealGame[Index])
- if Type == "function" then
- if Index:lower() == "getservice" or Index:lower() == "service" then
- return function (self,Service)
- local FakeServices = {
- ["players"] = function()
- return setmetatable({},{
- __index = function (self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...)end
- else
- if Index2:lower() == "localplayer" then return Sandbox(owner) end
- return RealService[Index2]
- end
- end;
- __tostring = function(self) return RealGame:GetService(Service).Name end
- })
- end;
- ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
- ["userinputservice"] = function() return InternalData["UserInputService"] end;
- ["runservice"] = function()
- return setmetatable({},{
- __index = function(self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...) end
- else
- local RunServices = {
- ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
- ["renderstepped"] = function() return RealService["Stepped"] end
- }
- if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
- return RealService[Index2]
- end
- end
- })
- end
- }
- if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
- return RealGame:GetService(Service)
- end
- end
- return function (self,...) return RealGame[Index](RealGame,...) end
- else
- if game:GetService(Index) then return game:GetService(Index) end
- return RealGame[Index]
- end
- end
- return nil
- end
- });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("100%!")
- if script == nil then return end
- ModelName = "Mustard Gas G."
- Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("MasterSkips")
- Selected = false
- Connected = false
- Button1Down = false
- CanUse = true
- Thrown = false
- FirstPerson = game:GetService("InsertService"):LoadAsset(60568552)["FirstPerson"].Value
- MouseAim = game:GetService("InsertService"):LoadAsset(61527949)["MouseAim"].Value
- function CheckPlayer()
- if Player.Character == nil then return false end
- if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
- if Player.Character.Humanoid.Health <= 0 then return false end
- return true
- end
- loadstring(game:GetService("InsertService"):LoadAsset(65363615)["tagHumanoid"].Value)()
- loadstring(game:GetService("InsertService"):LoadAsset(63178291)["CameraPunch"].Value)()
- loadstring(game:GetService("InsertService"):LoadAsset(62991657)["PacketFunctions"].Value)()
- function CreateParts(Parent, Format)
- if Parent == nil then return end
- local Parts = Instance.new("Model")
- Parts.Name = ModelName
- if Format == 1 then
- Parts.Name = Parts.Name.. " (Holstered)"
- end
- Parts.Parent = Parent
- local MasterPart = Instance.new("Part")
- MasterPart.Name = "Handle"
- MasterPart.BrickColor = BrickColor.new("Bright yellow")
- MasterPart.TopSurface = 0
- MasterPart.BottomSurface = 0
- MasterPart.FormFactor = "Custom"
- MasterPart.Size = Vector3.new(0.4, 0.9, 0.4)
- MasterPart.Parent = Parts
- Instance.new("SpecialMesh", MasterPart).MeshType = "Head"
- local Weld = Instance.new("Weld")
- Weld.Part0 = MasterPart
- if Format == 1 then
- Weld.Part1 = Player.Character:FindFirstChild("Left Leg")
- Weld.C0 = CFrame.new(0.75, 0, 0.7) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
- elseif Format == 2 then
- Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
- Weld.C0 = CFrame.new(0, 0, 1.2) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
- end
- Weld.Parent = Weld.Part0
- local Part = Instance.new("Part")
- Part.Name = "Stripe Top"
- Part.BrickColor = BrickColor.new("Really black")
- Part.TopSurface = 0
- Part.BottomSurface = 0
- Part.FormFactor = "Custom"
- Part.Size = Vector3.new(0.45, 0.2, 0.45)
- Part.Parent = Parts
- Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.1, 1)
- local Weld = Instance.new("Weld")
- Weld.Part0 = Part
- Weld.Part1 = MasterPart
- Weld.C0 = CFrame.new(0, -0.2, 0)
- Weld.Parent = Weld.Part0
- local Part = Instance.new("Part")
- Part.Name = "Stripe Bottom"
- Part.BrickColor = BrickColor.new("Really black")
- Part.TopSurface = 0
- Part.BottomSurface = 0
- Part.FormFactor = "Custom"
- Part.Size = Vector3.new(0.45, 0.2, 0.45)
- Part.Parent = Parts
- Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.1, 1)
- local Weld = Instance.new("Weld")
- Weld.Part0 = Part
- Weld.Part1 = MasterPart
- Weld.C0 = CFrame.new(0, 0.2, 0)
- Weld.Parent = Weld.Part0
- local Part = Instance.new("Part")
- Part.Name = "Stripe Center"
- Part.BrickColor = BrickColor.new("CGA brown")
- Part.TopSurface = 0
- Part.BottomSurface = 0
- Part.FormFactor = "Custom"
- Part.Size = Vector3.new(0.425, 0.4, 0.425)
- Part.Parent = Parts
- Instance.new("CylinderMesh", Part)
- local Weld = Instance.new("Weld")
- Weld.Part0 = Part
- Weld.Part1 = MasterPart
- Weld.Parent = Weld.Part0
- local Part = Instance.new("Part")
- Part.Name = "Pin Holder"
- Part.BrickColor = BrickColor.new("Dark stone grey")
- Part.TopSurface = 0
- Part.BottomSurface = 0
- Part.FormFactor = "Custom"
- Part.Size = Vector3.new(0.2, 0.4, 0.2)
- Part.Parent = Parts
- Instance.new("CylinderMesh", Part)
- local Weld = Instance.new("Weld")
- Weld.Part0 = Part
- Weld.Part1 = MasterPart
- Weld.C0 = CFrame.new(0, -0.5, 0)
- Weld.Parent = Weld.Part0
- local MasterPart2 = Instance.new("Part")
- MasterPart2.Name = "Pin"
- MasterPart2.BrickColor = BrickColor.new("Dark stone grey")
- MasterPart2.TopSurface = 0
- MasterPart2.BottomSurface = 0
- MasterPart2.FormFactor = "Custom"
- MasterPart2.Size = Vector3.new(0.2, 0.2, 0.2)
- MasterPart2.Parent = Parts
- local Mesh = Instance.new("SpecialMesh", MasterPart2)
- Mesh.MeshType = "Brick"
- Mesh.Scale = Vector3.new(0.3, 0.1, 0.1)
- local Weld = Instance.new("Weld")
- Weld.Part0 = MasterPart2
- Weld.Part1 = MasterPart
- Weld.C0 = CFrame.new(0.125, -0.6, 0)
- Weld.Parent = Weld.Part0
- local Part = Instance.new("Part")
- Part.Name = "Pin Ring"
- Part.BrickColor = BrickColor.new("Dark stone grey")
- Part.TopSurface = 0
- Part.BottomSurface = 0
- Part.FormFactor = "Custom"
- Part.Size = Vector3.new(0.2, 0.2, 0.2)
- Part.Parent = Parts
- Instance.new("CylinderMesh", Part).Scale = Vector3.new(0.75, 0.1, 0.75)
- local Weld = Instance.new("Weld")
- Weld.Part0 = Part
- Weld.Part1 = MasterPart2
- Weld.C0 = CFrame.new(0.1, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
- Weld.Parent = Weld.Part0
- for _, Part in pairs(Parts:GetChildren()) do
- Part.Locked = true
- Part.CanCollide = false
- end
- end
- function RemoveParts(Parent, Format)
- if Format == 1 then
- pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
- elseif Format == 2 then
- pcall(function() Parent[ModelName]:Remove() end)
- end
- end
- function SetAngle(Joint, Angle, Character)
- if Character == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- if Joints[Joint] == nil then return false end
- if Joint == 1 or Joint == 3 then
- Joints[Joint].DesiredAngle = Angle
- end
- if Joint == 2 or Joint == 4 then
- Joints[Joint].DesiredAngle = -Angle
- end
- end
- function ForceAngle(Joint, Angle, Character)
- if Character == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- if Joints[Joint] == nil then return false end
- if Joint == 1 or Joint == 3 then
- Joints[Joint].DesiredAngle = Angle
- Joints[Joint].CurrentAngle = Angle
- end
- if Joint == 2 or Joint == 4 then
- Joints[Joint].DesiredAngle = -Angle
- Joints[Joint].CurrentAngle = -Angle
- end
- end
- function SetSpeed(Joint, Speed, Character)
- if Character == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- if Joints[Joint] == nil then return false end
- Joints[Joint].MaxVelocity = Speed
- end
- function DisableLimb(Limb, Character)
- if Character == nil then return false end
- if Character:FindFirstChild("Torso") == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder"),
- Character.Torso:FindFirstChild("Left Shoulder"),
- Character.Torso:FindFirstChild("Right Hip"),
- Character.Torso:FindFirstChild("Left Hip")
- }
- local Limbs = {
- Character:FindFirstChild("Right Arm"),
- Character:FindFirstChild("Left Arm"),
- Character:FindFirstChild("Right Leg"),
- Character:FindFirstChild("Left Leg")
- }
- if Joints[Limb] == nil then return false end
- if Limbs[Limb] == nil then return false end
- local Joint = Instance.new("Motor6D")
- Joint.Parent = Character.Torso
- Joint.Part0 = Character.Torso
- Joint.Part1 = Limbs[Limb]
- if Limb == 1 then
- Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.Name = "Right Shoulder 2"
- elseif Limb == 2 then
- Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.Name = "Left Shoulder 2"
- elseif Limb == 3 then
- Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.Name = "Right Hip 2"
- elseif Limb == 4 then
- Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.Name = "Left Hip 2"
- end
- Joint.MaxVelocity = Joints[Limb].MaxVelocity
- Joint.CurrentAngle = Joints[Limb].CurrentAngle
- Joint.DesiredAngle = Joints[Limb].DesiredAngle
- Joints[Limb]:Remove()
- end
- function ResetLimbCFrame(Limb, Character)
- if Character == nil then return false end
- if Character.Parent == nil then return false end
- if Character:FindFirstChild("Torso") == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- local Limbs = {
- Character:FindFirstChild("Right Arm"),
- Character:FindFirstChild("Left Arm"),
- Character:FindFirstChild("Right Leg"),
- Character:FindFirstChild("Left Leg")
- }
- if Joints[Limb] == nil then return false end
- if Limbs[Limb] == nil then return false end
- if Limb == 1 then
- Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- elseif Limb == 2 then
- Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- elseif Limb == 3 then
- Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- elseif Limb == 4 then
- Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- end
- end
- function EnableLimb(Limb, Character)
- if Character == nil then return false end
- if Character:FindFirstChild("Torso") == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- local Limbs = {
- Character:FindFirstChild("Right Arm"),
- Character:FindFirstChild("Left Arm"),
- Character:FindFirstChild("Right Leg"),
- Character:FindFirstChild("Left Leg")
- }
- if Joints[Limb] == nil then return false end
- if Limbs[Limb] == nil then return false end
- if Limb == 1 then
- Joints[Limb].Name = "Right Shoulder"
- elseif Limb == 2 then
- Joints[Limb].Name = "Left Shoulder"
- elseif Limb == 3 then
- Joints[Limb].Name = "Right Hip"
- elseif Limb == 4 then
- Joints[Limb].Name = "Left Hip"
- end
- Animate = Character:FindFirstChild("Animate")
- if Animate == nil then return false end
- Animate = Animate:Clone()
- Character.Animate:Remove()
- Animate.Parent = Character
- end
- function onButton1Down(Mouse)
- if Button1Down == true then return end
- Button1Down = true
- if CheckPlayer() == false or Primed == true or Thrown == true or CanUse == false then return end
- CanUse = false
- Primed = true
- SoundToServer("Pin", "http://www.roblox.com/Asset/?id=2697295", 5, 1, false, Player.Character.Torso)
- pcall(function() Player.Character[ModelName].Pin.Weld:Remove() end)
- for _, Part in pairs(Player.Character[ModelName]:GetChildren()) do
- pcall(function()
- if string.match(Part.Name, "Pin") then
- Part.CanCollide = true
- end
- end)
- end
- Instance.new("Configuration", Player.Character[ModelName].Handle).Name = "CanExplode"
- SendToServer([[local MaxDistance = 30
- wait(4)
- local Sound = Instance.new("Sound")
- Sound.Name = "Hiss"
- Sound.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
- Sound.Volume = 0.25
- Sound.Pitch = 2
- Sound.Parent = Source
- local Smoke1 = Instance.new("Smoke", Source)
- Smoke1.Color = Color3.new(218 / 255, 165 / 255, 32 / 255)
- Smoke1.Size = MaxDistance
- Smoke1.RiseVelocity = 0
- local Smoke2 = nil
- pcall(function()
- Smoke2 = Instance.new("Smoke", Source.Parent["Pin Holder"])
- Smoke2.Color = Color3.new(218 / 255, 165 / 255, 32 / 255)
- Smoke2.Size = MaxDistance / 9
- Smoke2.RiseVelocity = MaxDisance / 2
- end)
- for i = 0, 1, 0.00125 do
- local Amount = (i < 0.5 and i or (1 - i)) * 2
- Smoke1.Opacity = Amount * 0.3
- pcall(function() Smoke2.Opacity = Amount end)
- Sound.Volume = Amount
- Sound:Play()
- for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
- if Player.Character ~= nil then
- if Player.Character:FindFirstChild("Head") ~= nil then
- local HasMask = false
- for _, Part in pairs(Player.Character:GetChildren()) do
- if Part.Name == "Gas Mask" then
- HasMask = true
- end
- end
- if HasMask == false then
- local Distance = (Player.Character.Head.Position - Source.Position).magnitude
- if Distance < MaxDistance then
- pcall(function() Player.Character.Humanoid:TakeDamage((((MaxDistance - Distance) / MaxDistance) * 0.5) * Amount) end)
- local StunGui = Instance.new("ScreenGui", Player.PlayerGui)
- StunGui.Name = "StunGui"
- local Yellow = Instance.new("Frame", StunGui)
- Yellow.Name = "Yellow"
- Yellow.BorderSizePixel = 0
- Yellow.BackgroundColor3 = Color3.new(218 / 255, 165 / 255, 32 / 255)
- Yellow.BackgroundTransparency = 0.95
- Yellow.Size = UDim2.new(2, 0, 2, 0)
- Yellow.Position = UDim2.new(-0.5, 0, -0.5, 0)
- coroutine.wrap(function()
- wait((((MaxDistance - Distance) / MaxDistance) * 2) * Amount)
- StunGui:Remove()
- end)()
- end
- end
- end
- end
- end
- wait()
- end
- Smoke1.Enabled = false
- pcall(function() Smoke2.Enabled = false end)
- wait(7.5)
- Source.Parent:Remove()]], "Smoke", {"Source", Player.Character[ModelName].Handle})
- Player.Character[ModelName].Changed:connect(function(Property)
- if Property == "Parent" then
- while CanUse == false do wait() end
- EnableLimb(1, Player.Character)
- UpdateFirstPerson()
- script.Parent:Remove()
- end
- end)
- CanUse = true
- end
- function onButton1Up(Mouse)
- if Button1Down == false then return end
- Button1Down = false
- if CanUse == false then return end
- if Player.Character:FindFirstChild(ModelName) ~= nil and Thrown == false then
- Thrown = true
- SetSpeed(1, 0.75, Player.Character)
- SetAngle(1, 0, Player.Character)
- wait()
- pcall(function() Player.Character[ModelName].Handle.Weld:Remove() end)
- for _, Part in pairs(Player.Character[ModelName]:GetChildren()) do
- pcall(function() Part.CanCollide = true end)
- end
- local BodyVelocity = Instance.new("BodyVelocity")
- BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- BodyVelocity.velocity = (Mouse.Hit.p - Player.Character[ModelName].Handle.Position).unit * 75
- BodyVelocity.Parent = Player.Character[ModelName].Handle
- game:GetService("Debris"):AddItem(BodyVelocity, 0.1)
- game:GetService("Debris"):AddItem(Player.Character[ModelName], 45)
- Player.Character[ModelName].Parent = Workspace
- end
- end
- function onKeyDown(Key, Mouse)
- if Selected == false then return end
- Key = Key:lower()
- if Button1Down == false and CanUse == true and CheckPlayer() == true then
- if Key == "q" then
- if Mouse.Target == nil then return end
- if CheckPlayer() == false then return end
- local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
- if NewPlayer == nil then return end
- if NewPlayer.Character == nil then return end
- if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
- if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
- onDeselected(Mouse)
- wait()
- RemoveParts(Player.Character, 1)
- script.Parent.Parent = NewPlayer.Backpack
- Player = NewPlayer
- elseif Key == "g" then
- CanUse = false
- SoundToServer("Slash", "rbxasset://sounds/swordslash.wav", 2, 1, false, Player.Character.Torso)
- SetSpeed(1, 0.75, Player.Character)
- SetAngle(1, 0, Player.Character)
- local HasHit = false
- local _, HitConnection = pcall(function() return Player.Character[ModelName].Handle.Touched:connect(function(Hit)
- if HasHit == true or Hit:IsDescendantOf(Player.Character) then return end
- HasHit = true
- SoundToServer("Bash", "http://www.roblox.com/Asset/?id=46153268", 1, 0.25, false, Player.Character.Torso)
- local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
- if Humanoid ~= nil then
- tagHumanoid(Humanoid)
- Humanoid:TakeDamage(7)
- wait()
- pcall(function() untagHumanoid(Humanoid) end)
- end
- end) end)
- CameraSlide(math.rad(-15), 0, 0.2)
- pcall(function() HitConnection:disconnect() end)
- SetSpeed(1, 0.5, Player.Character)
- SetAngle(1, math.rad(200), Player.Character)
- CameraSlide(math.rad(15), 0, 0.25)
- CanUse = true
- end
- end
- end
- function onSelected(Mouse)
- if Selected == true or CanUse == false then return end
- CanUse = false
- while true do
- if CheckPlayer() == true then
- if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil then
- break
- end
- end
- wait(0.1)
- end
- Selected = true
- RemoveParts(Player.Character, 1)
- CreateParts(Player.Character, 2)
- DisableLimb(1, Player.Character)
- SetSpeed(1, 0.5, Player.Character)
- SetAngle(1, math.rad(200), Player.Character)
- Mouse.Icon = "rbxasset://textures\\GunCursor.png"
- Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
- Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
- Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
- CanUse = true
- end
- function onDeselected(Mouse)
- if Selected == false or Primed == true then return end
- Selected = false
- while CanUse == false do wait() end
- if Selected == true then return end
- CanUse = false
- RemoveParts(Player.Character, 2)
- CreateParts(Player.Character, 1)
- SetAngle(1, 0, Player.Character)
- ResetLimbCFrame(1, Player.Character)
- EnableLimb(1, Player.Character)
- CanUse = true
- end
- if script.Parent.ClassName ~= "HopperBin" then
- if Player == nil then print("Error: Player not found!") return end
- Tool = Instance.new("HopperBin")
- Tool.Name = ModelName
- Tool.Parent = Player.Backpack
- script.Name = "Main"
- script.Parent = Tool
- elseif script.Parent.ClassName == "HopperBin" and Connected == false then
- Connected = true
- Player = script.Parent.Parent.Parent
- script.Parent.Selected:connect(onSelected)
- script.Parent.Deselected:connect(onDeselected)
- CreateParts(Player.Character, 1)
- coroutine.wrap(loadstring(FirstPerson))()
- coroutine.wrap(loadstring(MouseAim))()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement