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")
- Part2 = Instance.new("Part")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- SpecialMesh6 = Instance.new("SpecialMesh")
- Tool0.Name = "Chainsaw"
- Tool0.Parent = mas
- Tool0.TextureId = "rbxassetid://1166197683"
- Tool0.GripPos = Vector3.new(0, 0, 1.5)
- Script1.Name = "SwordScript"
- Script1.Parent = Tool0
- table.insert(cors,sandbox(Script1,function()
- -------- OMG HAX
- local game = game
- r = game:service("RunService")
- local damage = 19
- sword = script.Parent.Handle
- Tool = script.Parent
- function slice(hit)
- if (hit.Parent == nil) then return end -- happens when bullet hits sword
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- end
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- end
- function tagHumanoid(humanoid)
- creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- firing = false
- function onActivated()
- if not Tool.Enabled then
- return
- end
- character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- player = game.Players:findFirstChild(character.Name)
- if Tool.Handle:findFirstChild("Startup") ~= nil then
- Tool.Handle.Startup:play()
- end
- Tool.Enabled = false
- firing = true
- connection = script.Parent.Handle.Touched:connect(blow)
- Tool.Handle.attack:play()
- Tool.Handle.idle:stop()
- while firing do -- hold down the mouse button for a continuous attack
- Tool.Enabled = false
- wait(.25)
- end
- Tool.Handle.attack:stop()
- Tool.Handle.idle:play()
- connection:disconnect()
- Tool.Enabled = true
- end
- function onDeactivated()
- firing = false
- end
- function onEquipped() --gotta start the sounds!
- Tool.Handle.idle:play()
- Tool.Handle.start:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Deactivated:connect(onDeactivated)
- script.Parent.Equipped:connect(onEquipped)
- end))
- Part2.Name = "Handle"
- Part2.Parent = Tool0
- Part2.Material = Enum.Material.SmoothPlastic
- Part2.BrickColor = BrickColor.new("Dark stone grey")
- Part2.Reflectance = 0.40000000596046
- Part2.Rotation = Vector3.new(-90, 56, 90)
- Part2.FormFactor = Enum.FormFactor.Plate
- Part2.Size = Vector3.new(1, 0.800000012, 4)
- Part2.CFrame = CFrame.new(5.20054579, 75.2034988, 65.5599976, 0, -0.559192896, 0.829037607, 0, 0.829037607, 0.559192896, -1, 0, 0)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part2.Position = Vector3.new(5.20054579, 75.2034988, 65.5599976)
- Part2.Orientation = Vector3.new(-34, 90, 0)
- Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Sound3.Name = "idle"
- Sound3.Parent = Part2
- Sound3.SoundId = "http://www.roblox.com/asset/?id=2766581"
- Sound3.Volume = 1
- Sound3.Looped = true
- Sound4.Name = "attack"
- Sound4.Parent = Part2
- Sound4.SoundId = "http://www.roblox.com/asset/?id=161420059"
- Sound4.Looped = true
- Sound5.Name = "start"
- Sound5.Parent = Part2
- Sound5.SoundId = "rbxassetid://258741207"
- Sound5.Volume = 2
- SpecialMesh6.Name = "KnifeMesh"
- SpecialMesh6.Parent = Part2
- SpecialMesh6.MeshId = "rbxassetid://536945307"
- SpecialMesh6.Offset = Vector3.new(0, -0.200000003, 0)
- SpecialMesh6.Scale = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- SpecialMesh6.TextureId = "rbxassetid://536945378"
- SpecialMesh6.MeshType = Enum.MeshType.FileMesh
- SpecialMesh6.Scale = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- 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