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")
- Script1 = Instance.new("Script")
- Script2 = Instance.new("Script")
- Script3 = Instance.new("Script")
- LocalScript4 = Instance.new("LocalScript")
- LocalScript5 = Instance.new("LocalScript")
- LocalScript6 = Instance.new("LocalScript")
- Part7 = Instance.new("Part")
- Sound8 = Instance.new("Sound")
- Sound9 = Instance.new("Sound")
- SpecialMesh10 = Instance.new("SpecialMesh")
- Script11 = Instance.new("Script")
- Tool12 = Instance.new("Tool")
- Part13 = Instance.new("Part")
- SpecialMesh14 = Instance.new("SpecialMesh")
- Script15 = Instance.new("Script")
- LocalScript16 = Instance.new("LocalScript")
- Script17 = Instance.new("Script")
- Script18 = Instance.new("Script")
- SpecialMesh19 = Instance.new("SpecialMesh")
- Tool0.Name = "ParalyzerStunGun"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=13505853"
- Tool0.GripForward = Vector3.new(-0, 1, -0)
- Tool0.GripPos = Vector3.new(0, -0.600000024, -0.550000012)
- Tool0.GripUp = Vector3.new(0, 0, 1)
- Script1.Name = "LaserBlast"
- Script1.Parent = Tool0
- table.insert(cors,sandbox(Script1,function()
- ball = script.Parent
- function onTouched(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid ~= nil and hit.Parent:findFirstChild("RagdollScript") == nil then
- script.RagdollScript:Clone().Parent = humanoid.Parent
- hit.archivable = true
- hit.Locked = false
- end
- end
- connection = ball.Touched:connect(onTouched)
- wait(10)
- ball.Parent = nil
- end))
- Script2.Name = "RagdollScript"
- Script2.Parent = Script1
- table.insert(cors,sandbox(Script2,function()
- Character = script.Parent
- Torso = Character.Torso
- if Character then
- if Torso then
- Humanoid = Character:findFirstChild("Humanoid")
- Zombie = Character:findFirstChild("Zombie")
- if Humanoid ~= nil then
- Humanoid.PlatformStand = true
- end
- if Zombie ~= nil then
- Zombie.PlatformStand = true
- end
- local Head = Character:FindFirstChild("Head")
- if Head then
- local Neck = Instance.new("Weld")
- Neck.Name = "Neck"
- Neck.Part0 = Torso
- Neck.Part1 = Head
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Neck.C1 = CFrame.new()
- Neck.Parent = Torso
- end
- local Limb = Character:FindFirstChild("Right Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Right Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 4)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 3)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- --[
- local Bar = Instance.new("Part")
- Bar.TopSurface = 0
- Bar.BottomSurface = 0
- Bar.formFactor = "Symmetric"
- Bar.Size = Vector3.new(1, 1, 1)
- Bar.Transparency = 1
- Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
- Bar.Parent = Character
- local Weld = Instance.new("Weld")
- Weld.Part0 = Torso
- Weld.Part1 = Bar
- Weld.C0 = CFrame.new(0, 0.5, 0)
- Weld.Parent = Torso
- --]]
- end
- end
- end))
- Script3.Name = "RayGun"
- Script3.Parent = Tool0
- table.insert(cors,sandbox(Script3,function()
- local Tool = script.Parent;
- enabled = true
- local spark = Instance.new("Sparkles")
- spark.Color = Color3.new(5,2,9)
- function fire(v)
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local missile = Instance.new("Part")
- spark:Clone().Parent = missile
- local spawnPos = vCharacter.PrimaryPart.Position
- local PewPew = Tool.Handle:FindFirstChild("PewPew")
- if (PewPew == nil) then
- PewPew = Instance.new("Sound")
- PewPew.Name = "PewPew"
- PewPew.SoundId = "http://www.roblox.com/asset/?id=13775480"
- PewPew.Parent = Tool.Handle
- PewPew.Volume = 1
- end
- spawnPos = spawnPos + (v * 10)
- missile.Position = spawnPos
- missile.Size = Vector3.new(1,1,1)
- missile.Velocity = v * 180
- missile.BrickColor = BrickColor.new(1006)
- missile.Shape = 0
- missile.BottomSurface = 0
- missile.TopSurface = 0
- missile.Name = "Spark"
- missile.Reflectance = .3
- local force = Instance.new("BodyForce")
- force.force = Vector3.new(0,98,0)
- force.Parent = missile
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = missile
- local new_script = script.Parent.LaserBlast:clone()
- new_script.Disabled = false
- new_script.Parent = missile
- missile.Parent = game.Workspace
- PewPew:Play()
- end
- function gunUp()
- Tool.GripForward = Vector3.new(0,.981,-.196)
- Tool.GripRight = Vector3.new(1,0,0)
- Tool.GripUp = Vector3.new(0,.196,.981)
- end
- function gunOut()
- Tool.GripForward = Vector3.new(0,1,0)
- Tool.GripRight = Vector3.new(1,0,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function onActivated()
- if not enabled then
- return
- end
- enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- local targetPos = humanoid.TargetPoint
- local lookAt = (targetPos - character.Head.Position).unit
- local reload = .2
- gunUp()
- fire(lookAt)
- wait(reload)
- gunOut()
- wait(reload)
- enabled = true
- end
- function onEquipped()
- Tool.Handle.EquipSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- end))
- LocalScript4.Name = "BackGun"
- LocalScript4.Parent = Tool0
- table.insert(cors,sandbox(LocalScript4,function()
- --machokickface
- guntype = 1
- weldmode = 2
- model = nil
- distance = 0.85
- rotation = 55
- y = 0
- x = 0
- -------------------------------------------------------------------------------------------------------------------------------------------------------------------
- parts = {}
- local n = 1
- --Gun types
- function on(mouse)
- if model == nil then
- n = 1
- local m = Instance.new("Model")
- local all = script.Parent:GetChildren()
- for i = 1, #all do
- if all[i].className == "Part" then
- parts[n] = all[i].Transparency
- local brick = all[i]:clone()
- brick.Parent = m
- n = n +1
- end
- end
- wait()
- if model == nil then
- local weld = script:FindFirstChild("Weld2")
- if weld ~= nil then
- local new = weld:clone()
- new.Disabled = false
- new.Parent = m
- m.Name = script.Parent.Name
- m.Parent = script.Parent.Parent
- model = m
- local handle = model:FindFirstChild("Handle")
- if handle ~= nil then
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- if guntype == 1 then
- local torso = model.Parent:FindFirstChild("Torso")
- if torso ~= nil then
- if weldmode == 1 then--barrel pointing upper-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2), 0)
- elseif weldmode == 2 then--barrel pointing upper-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2 ) *-1, 0)
- elseif weldmode == 3 then--barrel pointing upside-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, -0.1+y, 0.2 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2), -1.5)
- elseif weldmode == 4 then--barrel pointing upside-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2 +rotation) *-1.1, 1)
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- elseif guntype == 2 then--BullPup
- local torso = model.Parent:FindFirstChild("Torso")
- if torso ~= nil then
- if weldmode == 1 then--barrel pointing upper-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.25+y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2, 0)
- elseif weldmode == 2 then--barrel pointing upper-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2 *-1, 0)
- elseif weldmode == 3 then--barrel pointing upside-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2, 0)
- elseif weldmode == 4 then--barrel pointing upside-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2 *-1, 0)
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- elseif guntype == 3 then--pistol
- local lleg = model.Parent:FindFirstChild("Left Leg")
- local rleg = model.Parent:FindFirstChild("Right Leg")
- if lleg ~= nil and rleg ~= nil then
- if weldmode == 1 then--pistol on right leg
- local w = Instance.new("Weld")
- w.Part0 = rleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
- elseif weldmode == 2 then--pistol on left leg
- local w = Instance.new("Weld")
- w.Part0 = lleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
- elseif weldmode == 3 then--knife in pant's back, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2, 0)
- elseif weldmode == 4 then--knife in pant's front, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2 *-1, 0)
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- elseif guntype == 4 then--knife
- local lleg = model.Parent:FindFirstChild("Left Leg")
- local rleg = model.Parent:FindFirstChild("Right Leg")
- local torso = model.Parent:FindFirstChild("Torso")
- if lleg ~= nil and rleg ~= nil and torso ~= nil then
- if weldmode == 1 then--pistol on right leg
- local w = Instance.new("Weld")
- w.Part0 = rleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
- elseif weldmode == 2 then--pistol on left leg
- local w = Instance.new("Weld")
- w.Part0 = lleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
- elseif weldmode == 3 then--knife in pant's back, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2, 0)
- elseif weldmode == 4 then--knife in pant's front, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2 *-1, 0)
- end
- end
- end
- end
- end
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- if model ~= nil then
- n = 1
- local all = model:GetChildren()
- for i = 1, #all do
- if all[i].className == "Part" then
- all[i].Transparency = 1
- end
- end
- end
- end
- --check
- function off(mouse)
- if model ~= nil then
- n = 1
- local all = model:GetChildren()
- for i = 1, #all do
- if all[i].className == "Part" then
- all[i].Transparency = parts[n]
- local Do = true
- if Do then
- Do = false--false check
- n = n +1
- end
- end
- end
- end
- end
- --done!
- script.Parent.Equipped:connect(on)
- script.Parent.Unequipped:connect(off)
- end))
- LocalScript5.Name = "WeldScript"
- LocalScript5.Parent = LocalScript4
- LocalScript5.Disabled = true
- table.insert(cors,sandbox(LocalScript5,function()
- function Weld(x,y)
- local W = Instance.new("Weld")
- W.Part0 = x
- W.Part1 = y
- local CJ = CFrame.new(x.Position)
- local C0 = x.CFrame:inverse()*CJ
- local C1 = y.CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = x
- end
- function Get(A)
- if A.className == "Part" then
- Weld(script.Parent.Handle, A)
- A.Anchored = false
- else
- local C = A:GetChildren()
- for i=1, #C do
- Get(C[i])
- end
- end
- end
- local yes = true
- if yes then
- yes = false
- Get(script.Parent)
- end
- function onDied()
- script.Parent.Parent = nil
- end
- h = script.Parent.Parent:FindFirstChild("Humanoid")
- if h ~= nil then
- h.Died:connect(onDied)
- end
- end))
- LocalScript6.Name = "Local Gui"
- LocalScript6.Parent = Tool0
- table.insert(cors,sandbox(LocalScript6,function()
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- wait(.2)
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- Tool.Equipped:connect(onEquippedLocal)
- end))
- Part7.Name = "Handle"
- Part7.Parent = Tool0
- Part7.BrickColor = BrickColor.new("Bright green")
- Part7.Rotation = Vector3.new(-90, 90, 0)
- Part7.Size = Vector3.new(1, 2.4000001, 1)
- Part7.CFrame = CFrame.new(-97.5, 0.5, 131.800003, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- Part7.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part7.Position = Vector3.new(-97.5, 0.5, 131.800003)
- Part7.Orientation = Vector3.new(0, 90, -90)
- Part7.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Sound8.Name = "EquipSound"
- Sound8.Parent = Part7
- Sound8.SoundId = "http://www.roblox.com/asset/?id=10756118"
- Sound9.Name = "PewPew"
- Sound9.Parent = Part7
- Sound9.SoundId = "http://www.roblox.com/asset/?id=13775480"
- Sound9.Volume = 1
- SpecialMesh10.Parent = Part7
- SpecialMesh10.MeshId = "http://www.roblox.com/asset/?id=22963494"
- SpecialMesh10.Scale = Vector3.new(0.649999976, 1, 0.649999976)
- SpecialMesh10.TextureId = "http://www.roblox.com/asset/?id=46095939"
- SpecialMesh10.VertexColor = Vector3.new(9, 1, 0)
- SpecialMesh10.MeshType = Enum.MeshType.FileMesh
- SpecialMesh10.Scale = Vector3.new(0.649999976, 1, 0.649999976)
- Script11.Name = "WeldArm"
- Script11.Parent = Tool0
- table.insert(cors,sandbox(Script11,function()
- Tool = script.Parent;
- local arms = nil
- local torso = nil
- local welds = {}
- function Equip(mouse)
- wait(0.01)
- arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
- torso = Tool.Parent:FindFirstChild("Torso")
- if arms ~= nil and torso ~= nil then
- local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
- if sh ~= nil then
- local yes = true
- if yes then
- yes = false
- sh[1].Part1 = nil
- sh[2].Part1 = nil
- local weld1 = Instance.new("Weld")
- weld1.Part0 = torso
- weld1.Parent = torso
- weld1.Part1 = arms[1]
- weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
- welds[1] = weld1
- local weld2 = Instance.new("Weld")
- weld2.Part0 = torso
- weld2.Parent = torso
- weld2.Part1 = arms[2]
- weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- welds[2] = weld2
- end
- else
- print("sh")
- end
- else
- print("arms")
- end
- end
- function Unequip(mouse)
- if arms ~= nil and torso ~= nil then
- local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
- if sh ~= nil then
- local yes = true
- if yes then
- yes = false
- sh[1].Part1 = arms[1]
- sh[2].Part1 = arms[2]
- welds[1].Parent = nil
- welds[2].Parent = nil
- end
- else
- print("sh")
- end
- else
- print("arms")
- end
- end
- Tool.Equipped:connect(Equip)
- Tool.Unequipped:connect(Unequip)
- end))
- Tool12.Name = "Sleep Dart Gun"
- Tool12.Parent = mas
- Tool12.TextureId = "http://www.roblox.com/asset/?id=21514222"
- Tool12.GripForward = Vector3.new(0.999861121, -0.0166643523, 0)
- Tool12.GripPos = Vector3.new(-1, -0.699999988, 1.5)
- Tool12.GripRight = Vector3.new(-0, 0, 1)
- Tool12.GripUp = Vector3.new(0.0166643523, 0.999861121, 0)
- Part13.Name = "Handle"
- Part13.Parent = Tool12
- Part13.BrickColor = BrickColor.new("Black")
- Part13.Reflectance = 0.10000000149012
- Part13.Rotation = Vector3.new(180, 0, -0.00999999978)
- Part13.Locked = true
- Part13.FormFactor = Enum.FormFactor.Symmetric
- Part13.Size = Vector3.new(1, 1, 1)
- Part13.CFrame = CFrame.new(-99.5000687, 0.50007242, 128.5, 1, 0.00014496794, -7.4505806e-08, 0.000144967926, -0.999999881, -3.41060513e-13, -5.96046448e-08, -1.09139364e-11, -0.999999881)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.TopSurface = Enum.SurfaceType.Smooth
- Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part13.Position = Vector3.new(-99.5000687, 0.50007242, 128.5)
- Part13.Orientation = Vector3.new(0, -180, 179.98999)
- Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh14.Parent = Part13
- SpecialMesh14.MeshId = "http://www.roblox.com/asset/?id=12221651"
- SpecialMesh14.Scale = Vector3.new(0.75, 0.460000008, 0.400000006)
- SpecialMesh14.MeshType = Enum.MeshType.FileMesh
- SpecialMesh14.Scale = Vector3.new(0.75, 0.460000008, 0.400000006)
- Script15.Parent = Part13
- table.insert(cors,sandbox(Script15,function()
- while true do
- script.Parent.Locked=true
- wait()
- end
- end))
- LocalScript16.Name = "Local Gui"
- LocalScript16.Parent = Tool12
- table.insert(cors,sandbox(LocalScript16,function()
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- wait(2)
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- Tool.Equipped:connect(onEquippedLocal)
- end))
- Script17.Name = "Slingshot"
- Script17.Parent = Tool12
- table.insert(cors,sandbox(Script17,function()
- Tool = script.Parent
- VELOCITY = 150 -- constant
- local Pellet = Instance.new("Part")
- Pellet.Name = "Dart"
- Pellet.Locked = true
- Pellet.BackSurface = 0
- Pellet.BottomSurface = 0
- Pellet.FrontSurface = 0
- Pellet.LeftSurface = 0
- Pellet.RightSurface = 0
- Pellet.TopSurface = 0
- Pellet.Reflectance = 0
- Pellet.BrickColor = BrickColor.new(21)
- Pellet.Shape = "Block"
- Pellet.Size = Vector3.new(1,1.2,1)
- script.Parent.PelletScript:clone().Parent = Pellet
- local mesh = Instance.new("SpecialMesh")
- mesh = Tool.Dart:clone()
- mesh.Scale = Vector3.new(0.2, 0.2 ,0.1)
- mesh.Parent = Pellet
- function fire(mouse_pos, offset)
- -- find player's head pos
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local head = vCharacter:findFirstChild("Head")
- if head == nil then return end
- local dir = mouse_pos - head.Position
- dir = computeDirection(dir)
- local pelletCF = CFrame.new(head.Position, head.Position + dir)
- local missile = Pellet:clone()
- missile.CFrame = pelletCF * offset
- local delta = mouse_pos - missile.CFrame.p
- local dy = delta.y
- local new_delta = Vector3.new(delta.x, 0, delta.z)
- delta = new_delta
- local dx = delta.magnitude
- local unit_delta = delta.unit
- -- acceleration due to gravity in RBX units
- local g = (1 * 20)
- local theta = computeLaunchAngle( dx, dy, g)
- local vy = math.sin(theta)
- local xz = math.cos(theta)
- local vx = unit_delta.x * xz
- local vz = unit_delta.z * xz
- missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY * 1.3
- missile.PelletScript.Disabled = false
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = missile
- missile.Parent = game.Workspace
- end
- function computeLaunchAngle(dx,dy,grav)
- -- arcane
- -- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
- local g = math.abs(grav)
- local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
- if inRoot <= 0 then
- return .25 * math.pi
- end
- local root = math.sqrt(inRoot)
- local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)
- local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
- local answer1 = math.atan(inATan1)
- local answer2 = math.atan(inATan2)
- if answer1 < answer2 then return answer1 end
- return answer2
- end
- function computeDirection(vec)
- local lenSquared = vec.magnitude * vec.magnitude
- local invSqrt = 1 / math.sqrt(lenSquared)
- return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
- end
- Tool.Enabled = true
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- local targetPos = humanoid.TargetPoint
- for i=1,1 do
- for j=1,1 do
- fire(targetPos, CFrame.new(i,j,-5))
- end
- end
- wait(2)
- Tool.Enabled = true
- end
- script.Parent.Activated:connect(onActivated)
- end))
- Script18.Name = "PelletScript"
- Script18.Parent = Tool12
- Script18.Disabled = true
- table.insert(cors,sandbox(Script18,function()
- pellet = script.Parent
- damage = 0
- welded = false
- function stick(hit)
- welded = true
- -- joint myself to the thing i hit
- local weld = Instance.new("Weld")
- weld.Part0 = pellet
- weld.Part1 = hit
- local HitPos = pellet.Position + (pellet.CFrame.lookVector * .5)
- local CJ = CFrame.new(HitPos)
- local C0 = pellet.CFrame:inverse() *CJ
- local C1 = hit.CFrame:inverse() * CJ
- weld.C0 = C0
- weld.C1 = C1
- weld.Parent = pellet
- end
- function onTouched(hit)
- if welded == false and hit.Parent:findFirstChild("Arrow") == nil then stick(hit) end
- humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- tagHumanoid(humanoid)
- humanoid.Health = humanoid.Health - damage
- humanoid.PlatformStand=true
- wait(2)
- untagHumanoid(humanoid)
- else
- wait(2)
- connection:disconnect()
- end
- end
- function tagHumanoid(humanoid)
- -- todo: make tag expire
- local tag = pellet:findFirstChild("creator")
- if tag ~= nil then
- local new_tag = tag:clone()
- new_tag.Parent = humanoid
- end
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- connection = pellet.Touched:connect(onTouched)
- wait(2)
- if welded then wait(2) end
- pellet.Parent = nil
- end))
- SpecialMesh19.Name = "Dart"
- SpecialMesh19.Parent = Tool12
- SpecialMesh19.MeshId = "http://www.roblox.com/asset/?id=2251534"
- SpecialMesh19.Scale = Vector3.new(0.200000003, 0.200000003, 0.100000001)
- SpecialMesh19.MeshType = Enum.MeshType.FileMesh
- SpecialMesh19.Scale = Vector3.new(0.200000003, 0.200000003, 0.100000001)
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- 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