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")
- LocalScript5 = Instance.new("LocalScript")
- Script6 = Instance.new("Script")
- Script7 = Instance.new("Script")
- NumberValue8 = Instance.new("NumberValue")
- Part9 = Instance.new("Part")
- SpotLight10 = Instance.new("SpotLight")
- Part11 = Instance.new("Part")
- SpecialMesh12 = Instance.new("SpecialMesh")
- Script13 = Instance.new("Script")
- Script14 = Instance.new("Script")
- Script15 = Instance.new("Script")
- Script16 = Instance.new("Script")
- Script17 = Instance.new("Script")
- LocalScript18 = Instance.new("LocalScript")
- LocalScript19 = Instance.new("LocalScript")
- LocalScript20 = Instance.new("LocalScript")
- LocalScript21 = Instance.new("LocalScript")
- LocalScript22 = Instance.new("LocalScript")
- LocalScript23 = Instance.new("LocalScript")
- Script24 = Instance.new("Script")
- Weld25 = Instance.new("Weld")
- Tool0.Name = "DarkMatterGun"
- Tool0.Parent = mas
- Tool0.GripPos = Vector3.new(0, 0, 0.699999988)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.BrickColor = BrickColor.new("Really black")
- Part1.Transparency = 1
- Part1.Rotation = Vector3.new(164.429993, 0, -180)
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.Size = Vector3.new(0.800000012, 1.29999995, 2.20000005)
- Part1.CFrame = CFrame.new(114.459999, 1.10675097, 10.1949997, -1, 0, 0, 0, 0.963300645, -0.268424839, 0, -0.268424839, -0.963300645)
- Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part1.Position = Vector3.new(114.459999, 1.10675097, 10.1949997)
- Part1.Orientation = Vector3.new(15.5699997, 180, 0)
- Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=85771489"
- SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=85884363"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
- Sound3.Parent = Part1
- Sound3.SoundId = "http://www.roblox.com/asset/?id=77170656"
- Sound3.Volume = 1
- Sound4.Name = "Reload"
- Sound4.Parent = Part1
- Sound4.SoundId = "http://www.roblox.com/asset/?id=131164874"
- Sound4.Volume = 1
- LocalScript5.Parent = Tool0
- table.insert(cors,sandbox(LocalScript5,function()
- --har he ho
- local Tool = script.Parent
- sp=script.Parent
- plr=game.Players.localPlayer
- damage=30
- local reloadTime = .25
- local orb
- local Mouse
- firerate=1
- local range = 250
- barreloffset=Vector3.new(0, 0.25, -1.7)
- windvec=Vector3.new(2,-1,1).unit
- rate=1/30
- debris=game:GetService("Debris")
- equipped=false
- check=true
- 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=131179973"
- PewPew.Parent = Tool.Handle
- PewPew.Pitch = 1 --.85
- PewPew.Volume = .85
- end
- local laserSound = Tool.Handle:FindFirstChild("LaserSound")
- if (laserSound == nil) then
- laserSound = Instance.new("Sound")
- laserSound.Name = "LaserSound"
- laserSound.SoundId = "http://www.roblox.com/asset/?id=131164846"
- laserSound.Parent = Tool.Handle
- laserSound.Pitch = 0.96 --.85
- laserSound.Volume = 3
- end
- function tagHumanoid(humanoid)
- local creator_tag=Instance.new("ObjectValue")
- creator_tag.Value=game.Players.LocalPlayer
- creator_tag.Name="creator"
- debris:AddItem(creator,.5)
- creator_tag.Parent=humanoid
- end
- function damagePartOwner(part, damage)
- if part and part.Parent and Tool and Tool.Parent and plr and Tool.Parent ~= part.Parent then
- local hum = part.Parent:FindFirstChild("Humanoid")
- if hum then
- tagHumanoid(hum)
- hum.Health = hum.Health - damage
- --hum:TakeDamage(damage)
- return true
- end
- end
- return false
- end
- function checkintangible(hit)
- if hit and hit~=nil then
- if hit:IsDescendantOf(Tool.Parent) or hit.Transparency>.9 or hit.Name=="Handle" or hit.Name=="Effect" or hit.Name=="Bullet" or hit.Name=="Laser" or string.lower(hit.Name)=="water" then
- return true
- end
- end
- return false
- end
- function castray(startpos,vec,length,ignore,delayifhit)
- local hit,endpos2=game.Workspace:FindPartOnRay(Ray.new(startpos,vec*length),ignore)
- if hit~=nil then
- if checkintangible(hit) then
- if delayifhit then
- wait()
- end
- hit,endpos2=castray(endpos2+(vec*.01),vec,length-((startpos-endpos2).magnitude),ignore,delayifhit)
- end
- end
- return hit,endpos2
- end
- function drawbeam(beamstart,beamend,clr,charge)
- local dist=(beamstart-beamend).magnitude
- local laser=Instance.new("Part")
- laser.Name="Effect"
- --laser.Anchored=true
- laser.CanCollide=false
- laser.Shape="Block"
- laser.formFactor="Custom"
- laser.Size=Vector3.new(.2,.2,.2)
- laser.Transparency=0
- laser.Material=Enum.Material.Plastic
- laser.Locked=true
- laser.TopSurface=0
- laser.BottomSurface=0
- laser.BrickColor=clr
- laser.CFrame=CFrame.new(beamend,beamstart)*CFrame.new(0,0,-dist/2)*CFrame.Angles(math.pi/2,0,0)
- local mesh=Instance.new("SpecialMesh")
- local scale = math.sqrt(charge/20)
- mesh.Scale=Vector3.new(scale,dist*5,scale)
- mesh.Parent=laser
- return laser
- end
- local charge = -100
- function fireSmallLaser(charge)
- if orb then
- PewPew:Play()
- --print("firing laser")
- local startpos = orb.Position
- local vec = (Mouse.Hit.p-startpos).unit
- local smallLaser = drawbeam(startpos, startpos + vec * 3, BrickColor.new(Color3.new(0,0,0)), charge )
- local bv = Instance.new("BodyVelocity")
- bv.velocity = vec *200
- bv.Parent = smallLaser
- debris:AddItem(smallLaser,5)
- smallLaser.Parent = game.Workspace
- local damage = 5+math.floor(charge/2)
- smallLaser.Touched:connect(function(hit)
- local didDamage = damagePartOwner(hit,damage)
- --print("hit, ", didDamage)
- if didDamage and smallLaser then smallLaser:Destroy() end
- end)
- orb:Destroy()
- end
- end
- function fireLargeLaser()
- local frames = 57
- local largeLaser
- laserSound:Play()
- for i = 1, frames do
- if not orb or not orb.Parent or not Mouse then break end
- local startpos = orb.Position
- local hit, endPos = castray(startpos, (Mouse.Hit.p-startpos).unit, range, Tool.Parent)
- damagePartOwner(hit,5)
- if largeLaser then largeLaser:Destroy() end
- largeLaser = drawbeam(startpos, endPos, BrickColor.new(Color3.new(0,0,0)), 300)
- largeLaser.Anchored = true
- debris:AddItem(largeLaser,.25)
- largeLaser.Parent = game.Workspace
- wait(1/30)
- end
- if largeLaser then largeLaser:Destroy() end
- if orb then orb:Destroy() end
- Tool.Handle.Reload:Play()
- wait(4)
- end
- local isFiring = false
- function mouseUp()
- --print("mouseUpped")
- --if Tool.Enabled then return end
- if not orb or not orb.Parent or isFiring then return end
- isFiring = true
- if Mouse then Mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" end
- --TODO: reset characters walkspeed
- if charge > 100 then
- charge = -100
- fireLargeLaser()
- else
- fireSmallLaser(charge)
- charge = -100
- end
- wait(reloadTime)
- isFiring = false
- Tool.Enabled = true
- if Mouse then Mouse.Icon = "rbxasset://textures\\GunCursor.png" end
- end
- function mouseDown()
- --print("mouseDowned")
- if not Tool.Enabled then return end
- Tool.Enabled = false
- if orb and orb.Parent then return end
- --TODO: nuke characters walkspeed
- charge = 5
- orb = Instance.new("Part")
- orb.FormFactor = "Symmetric"
- orb.Shape = "Ball"
- orb.CanCollide = false
- orb.Size = Vector3.new(1,1,1)
- orb.Transparency = .4
- orb.BrickColor = BrickColor.new(Color3.new(0,0,0))
- orb.TopSurface = "Smooth"
- orb.BottomSurface = "Smooth"
- local ballMesh = Instance.new("SpecialMesh")
- ballMesh.MeshType = "Sphere"
- ballMesh.Name = "SphereMesh"
- ballMesh.Parent = orb
- local scale = math.sqrt(charge/20)
- ballMesh.Scale = Vector3.new(scale,scale,scale)
- orb.Parent = Tool
- suckPartModel = orb:Clone()
- suckPartModel.Size = suckPartModel.Size * .5
- --suckPartModel.SphereMesh.Scale = suckPartModel.SphereMesh.Scale * .5
- local bv = Instance.new("BodyVelocity")
- bv.Name = "BV"
- bv.Parent = suckPartModel
- local orbWeld = Instance.new("ManualWeld")
- orbWeld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- orbWeld.C1 = CFrame.new(0.049407959, 0.30989188, -1.74499893, 0.999999881, -0.000551184872, -5.29387343e-008, 0.000551184872, 0.999999762, 1.45519152e-011, 4.31729106e-008, -1.45519152e-011, 1)
- orbWeld.Part0 = orb
- orbWeld.Part1 = Tool.Handle
- orbWeld.Parent = orb
- --TODO: make sure gun handle is correct first
- --TODO: weld orb to end of gun
- if Mouse then Mouse.TargetFilter = orb end --stops player from shooting at the special effects
- while orb and ballMesh and charge > 0 do
- local suckPart = suckPartModel:Clone()
- suckPart.CFrame = orb.CFrame + Vector3.new((math.random()-.5)*4,(math.random()-.5)*4,(math.random()-.5)*4)
- suckPart.BV.velocity = (orb.CFrame.p - suckPart.CFrame.p).unit *7
- debris:AddItem(suckPart,(orb.CFrame.p - suckPart.CFrame.p).magnitude/12)
- suckPart.Parent = orb
- --TODO: suck in particles
- if charge < 100 then
- scale = math.sqrt(charge/20)
- ballMesh.Scale = Vector3.new(scale,scale,scale)
- else
- local colorVal = math.max(charge %11, 11 - charge%11) --Varies smoothly from 6 to 11 and back
- local scaledColorVal = (colorVal-5)/20
- orb.BrickColor = BrickColor.new(Color3.new(1,scaledColorVal,scaledColorVal))
- --TODO make orb large and change color
- end
- charge = charge +1
- --print(charge)
- wait(1/30)
- end
- end
- function onEquipped(mouse)
- equipped=true
- if mouse~=nil then
- if not Tool.Enabled then
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- wait(2)
- Tool.Enabled = true
- end
- Mouse = mouse
- Mouse.Icon="rbxasset://textures\\GunCursor.png"
- Mouse.Button1Down:connect(mouseDown)
- Mouse.Button1Up:connect(mouseUp)
- end
- end
- function onUnequipped()
- if orb then orb:Destroy() end
- equipped=false
- end
- function movehead()
- --[[
- [Head/Waist Follow Mouse/Camera Script.]
- [Works with both R6 and R15, lets you turn your character's head and waist towards your mouse/camera.]
- [Scripted by (Unknown), upgraded by OhHeyItsCory.]
- [I'm not sure who made the original script and the person I found it from definitely didn't make it.]
- [If you find the original creator, please let me know so I can properly credit them <3]
- [Anyways, here's a list of what I've added.]
- [Waist rotation. (Previously, only the head turned.)]
- [Tweening. (Basically, animating the rotation instead of instantly turning.)]
- [Full body rotation. (If set to true, rotates the entire body towards the mouse.)]
- [Specific rotation limits. (The original script used one variable to set the limits of both horizontal and vertical rotation, now there's variables for both limits!)]
- --]]
- wait()
- --[Pre-Funcs]:
- local Ang = CFrame.Angles --[Storing these as variables so I dont have to type them out.]
- local aSin = math.asin
- local aTan = math.atan
- --[Constants]:
- local Cam = game.Workspace.CurrentCamera
- local Plr = game.Players.LocalPlayer
- local Mouse = Plr:GetMouse()
- local Body = Plr.Character or Plr.CharacterAdded:wait()
- local Head = Body:WaitForChild("Head")
- local Hum = Body:WaitForChild("Humanoid")
- local Core = Body:WaitForChild("HumanoidRootPart")
- local IsR6 = (Hum.RigType.Value==0) --[Checking if the player is using R15 or R6.]
- local Trso = (IsR6 and Body:WaitForChild("Torso")) or Body:WaitForChild("UpperTorso")
- local Neck = (IsR6 and Trso:WaitForChild("Neck")) or Head:WaitForChild("Neck") --[Once we know the Rig, we know what to find.]
- local Waist = (not IsR6 and Trso:WaitForChild("Waist")) --[R6 doesn't have a waist joint, unfortunately.]
- --[[
- [Whether rotation follows the camera or the mouse.]
- [Useful with tools if true, but camera tracking runs smoother.]
- --]]
- local MseGuide = false
- --[[
- [Whether the whole character turns to face the mouse.]
- [If set to true, MseGuide will be set to true and both HeadHorFactor and BodyHorFactor will be set to 0]
- --]]
- local TurnCharacterToMouse = false
- --[[
- [Horizontal and Vertical limits for head and body tracking.]
- [Setting to 0 negates tracking, setting to 1 is normal tracking, and setting to anything higher than 1 goes past real life head/body rotation capabilities.]
- --]]
- local HeadHorFactor = 1
- local HeadVertFactor = 0.6
- local BodyHorFactor = 0.5
- local BodyVertFactor = 0.4
- --[[
- [How fast the body rotates.]
- [Setting to 0 negates tracking, and setting to 1 is instant rotation. 0.5 is a nice in-between that works with MseGuide on or off.]
- [Setting this any higher than 1 causes weird glitchy shaking occasionally.]
- --]]
- local UpdateSpeed = 0.5
- local NeckOrgnC0 = Neck.C0 --[Get the base C0 to manipulate off of.]
- local WaistOrgnC0 = (not IsR6 and Waist.C0) --[Get the base C0 to manipulate off of.]
- --[Setup]:
- Neck.MaxVelocity = 1/3
- -- Activation]:
- if TurnCharacterToMouse == true then
- MseGuide = true
- HeadHorFactor = 0
- BodyHorFactor = 0
- end
- game:GetService("RunService").RenderStepped:Connect(function()
- local CamCF = Cam.CoordinateFrame
- if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then --[Check for the Torso and Head...]
- local TrsoLV = Trso.CFrame.lookVector
- local HdPos = Head.CFrame.p
- if IsR6 and Neck or Neck and Waist then --[Make sure the Neck still exists.]
- if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
- local Dist = nil;
- local Diff = nil;
- if not MseGuide then --[If not tracking the Mouse then get the Camera.]
- Dist = (Head.CFrame.p-CamCF.p).magnitude
- Diff = Head.CFrame.Y-CamCF.Y
- if not IsR6 then --[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.]
- Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
- Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
- else --[R15s actually have the properly oriented Neck CFrame.]
- Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2)
- end
- else
- local Point = Mouse.Hit.p
- Dist = (Head.CFrame.p-Point).magnitude
- Diff = Head.CFrame.Y-Point.Y
- if not IsR6 then
- Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
- Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
- else
- Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2)
- end
- end
- end
- end
- end
- if TurnCharacterToMouse == true then
- Hum.AutoRotate = false
- Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2)
- else
- Hum.AutoRotate = true
- end
- end)
- end
- Tool.Equipped:connect(movehead)
- Tool.Equipped:connect(onEquipped)
- Tool.Unequipped:connect(onUnequipped)
- end))
- Script6.Name = "SoundScript"
- Script6.Parent = Tool0
- Script6.Disabled = true
- table.insert(cors,sandbox(Script6,function()
- --Stickamsterluke
- --this script this made so that the sound is not played locally
- sp=script.Parent
- local s=Instance.new("Sound")
- s.Volume=2
- s.SoundId="http://www.roblox.com/asset/?id=77170993"
- s.Looped=false
- s.PlayOnRemove=false
- s.Parent=sp
- wait()
- s:Play()
- end))
- Script7.Parent = Tool0
- table.insert(cors,sandbox(Script7,function()
- --Stickamsterluke
- --this script this made so that the sound is not played locally
- sp=script.Parent
- wait(1)
- sp.PlaySound.Changed:connect(function()
- sp.Handle.Sound:Play()
- end)
- end))
- NumberValue8.Name = "PlaySound"
- NumberValue8.Parent = Tool0
- NumberValue8.Value = 1336154690.422
- Part9.Name = "Light"
- Part9.Parent = Tool0
- Part9.Transparency = 1
- Part9.Rotation = Vector3.new(164.429993, 0, -180)
- Part9.CanCollide = false
- Part9.FormFactor = Enum.FormFactor.Custom
- Part9.Size = Vector3.new(0.200000003, 0.240000144, 0.860001147)
- Part9.CFrame = CFrame.new(114.470001, 1.03175199, 10.0339975, -1, 0, 0, 0, 0.963300645, -0.268424839, 0, -0.268424839, -0.963300645)
- Part9.Position = Vector3.new(114.470001, 1.03175199, 10.0339975)
- Part9.Orientation = Vector3.new(15.5699997, 180, 0)
- SpotLight10.Parent = Part9
- SpotLight10.Brightness = 10
- SpotLight10.Range = 28
- SpotLight10.Shadows = true
- SpotLight10.Angle = 100
- Part11.Name = "gun"
- Part11.Parent = Tool0
- Part11.Rotation = Vector3.new(164.429993, 0, -180)
- Part11.CanCollide = false
- Part11.FormFactor = Enum.FormFactor.Symmetric
- Part11.Size = Vector3.new(2, 2, 2)
- Part11.CFrame = CFrame.new(114.449997, 1.23175001, 10.1620016, -1, 0, 0, 0, 0.963300645, -0.268424839, 0, -0.268424839, -0.963300645)
- Part11.Position = Vector3.new(114.449997, 1.23175001, 10.1620016)
- Part11.Orientation = Vector3.new(15.5699997, 180, 0)
- SpecialMesh12.Parent = Part11
- SpecialMesh12.MeshId = "http://www.roblox.com/asset/?id=139121396"
- SpecialMesh12.Scale = Vector3.new(2, 3, 3)
- SpecialMesh12.TextureId = "http://www.roblox.com/asset/?id=139333401"
- SpecialMesh12.MeshType = Enum.MeshType.FileMesh
- SpecialMesh12.Scale = Vector3.new(2, 3, 3)
- Script13.Name = "UltimateWeld"
- Script13.Parent = Tool0
- table.insert(cors,sandbox(Script13,function()
- --DO NOT USE BOTH WELDING SCRIPTS PROVIDED BY THIS MODEL
- --The regular script is recommended
- --[[
- Prevents welds from breaking/transforming when player uses the tool
- This recreates the EXACT weld every time
- This also prevents lag build up by clearing old welds, the tradition weld script just keeps making new
- ones, which can lead to weapons have crazy amounts of welds that dont work (I saw 6000 in a weapon once)
- ]]
- --[[Usage
- 1. Remove Old welding script (optional, only if updating a weapon and that weapon does not rely on that script)
- 2. Anchor all parts of tool and put inside of a tool object
- 3. Place this script in that tool (make sure you do this AFTER step 2, otherwise it may fail)
- 4. Treat like normal tool, nothing special has to be done with it
- ]]
- --[[The local script included in this model can only be used if
- 1. The weapon is being placed in the players backpack first (i.e. the weapon is in starterpack and moves to player backpack)
- OR
- 2. The weapon is previously welded (weapon can be placed in workspace and picked up then)
- ]]
- repeat wait() until script.Parent:FindFirstChild("Handle")
- local welds={}
- function ClearOldWelds(tbl)
- for _,v in pairs(tbl) do
- if v:IsA('Weld') then
- v:Destroy()
- end
- end
- end
- function Equipped()
- local handle=script.Parent:FindFirstChild('Handle')
- if not handle then return end
- local tble=handle:GetChildren()
- for _,v in pairs(script.Parent:GetChildren()) do
- if v:IsA('BasePart') and v~=handle then
- local c1
- for _1,v1 in pairs(welds) do
- if _1==v then
- c1=v1
- break
- end
- end
- if not c1 then
- welds[v]=v.CFrame:inverse()*handle.CFrame
- v.Anchored=false
- c1=welds[v]
- end
- local weld=Instance.new('Weld')
- weld.Part0=handle
- weld.Part1=v
- weld.C0=CFrame.new()
- weld.C1=c1
- weld.Parent=handle
- end
- end
- ClearOldWelds(tble)
- handle.Anchored=false
- end
- Equipped()
- script.Parent.Equipped:connect(Equipped)
- --Made by DonnyTheDemented
- end))
- Script14.Name = "Welding"
- Script14.Parent = Tool0
- table.insert(cors,sandbox(Script14,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- Script15.Name = "Welding"
- Script15.Parent = Tool0
- table.insert(cors,sandbox(Script15,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- Script16.Name = "Welding"
- Script16.Parent = Tool0
- table.insert(cors,sandbox(Script16,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- Script17.Name = "Welding"
- Script17.Parent = Tool0
- table.insert(cors,sandbox(Script17,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript18.Name = "BackupWeld"
- LocalScript18.Parent = Tool0
- table.insert(cors,sandbox(LocalScript18,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript19.Name = "BackupWeld"
- LocalScript19.Parent = Tool0
- table.insert(cors,sandbox(LocalScript19,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript20.Name = "BackupWeld"
- LocalScript20.Parent = Tool0
- table.insert(cors,sandbox(LocalScript20,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript21.Name = "BackupWeld"
- LocalScript21.Parent = Tool0
- table.insert(cors,sandbox(LocalScript21,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript22.Name = "BackupWeld"
- LocalScript22.Parent = Tool0
- table.insert(cors,sandbox(LocalScript22,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
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript23.Name = "AnimateScript"
- LocalScript23.Parent = Tool0
- table.insert(cors,sandbox(LocalScript23,function()
- ------------------------------------------------------WeldArm---------------------------------------------------------------
- Tool = script.Parent;
- local arms = nil
- local torso = nil
- local welds = {}
- local neck = nil
- local orginalC0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- function Equip(mouse)
- wait(0.01)
- arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
- head = Tool.Parent:FindFirstChild("Head")
- torso = Tool.Parent:FindFirstChild("Torso")
- if neck == nil then
- neck = Tool.Parent:FindFirstChild("Torso").Neck
- end
- 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.Name = "weld1"
- weld1.Part0 = head
- weld1.Parent = head
- weld1.Part1 = arms[1]
- welds[1] = weld1
- local weld2 = Instance.new("Weld")
- weld2.Name = "weld2"
- weld2.Part0 = head
- weld2.Parent = head
- weld2.Part1 = arms[2]
- welds[2] = weld2
- -------------------------here
- weld1.C1 = CFrame.new(0.7, 0.9, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(28), math.rad(-1)) ---The first set of numbers changes where the arms move to the second set changes their angles
- weld2.C1 = CFrame.new(-0.6, 0, -1) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-0.01), 0) --- Same as top
- mouse.Move:connect(function ()
- --local Direction = Tool.Direction.Value
- local Direction = mouse.Hit.p
- local b = head.Position.Y-Direction.Y
- local dist = (head.Position-Direction).magnitude
- local answer = math.asin(b/dist)
- neck.C0=orginalC0*CFrame.fromEulerAnglesXYZ(answer,0,0)
- wait(0.1)
- end)
- 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
- neck.C0 = orginalC0
- 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))
- Script24.Name = "SpinningScript"
- Script24.Parent = Tool0
- table.insert(cors,sandbox(Script24,function()
- --[[
- This is a script that makes an anchored brick rotate!
- Just resize the brick to your desired size!
- This script was made by ProjectTwo
- Free for anyone to use!
- ]]
- while true do
- wait()
- script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, math.pi/100, 0)
- end
- end))
- Weld25.Parent = Script24
- 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