Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by N3xul
- local runDummyScript = function(f,scri)
- local oldenv = getfenv(f)
- local newenv = setmetatable({}, {
- __index = function(_, k)
- if k:lower() == 'script' then
- return scri
- else
- return oldenv[k]
- end
- end
- })
- setfenv(f, newenv)
- ypcall(function() f() end)
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- mas.Name = "CompiledModel"
- o1 = Instance.new("Tool")
- o2 = Instance.new("Script")
- o3 = Instance.new("Part")
- o4 = Instance.new("SpecialMesh")
- o6 = Instance.new("LocalScript")
- o1.Name = "Windforce"
- o1.Parent = mas
- o1.GripForward = Vector3.new(-1, -0, -0)
- o1.GripPos = Vector3.new(0, 0, -1.75)
- o1.GripRight = Vector3.new(0, 1, 0)
- o1.GripUp = Vector3.new(0, 0, 1)
- o2.Name = "SwordScript"
- o2.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 10
- local slash_damage = 18
- local lunge_damage = 36
- sword = script.Parent.Handle
- Tool = script.Parent
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound.Parent = sword
- SlashSound.Volume = .7
- local LungeSound = Instance.new("Sound")
- LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
- LungeSound.Parent = sword
- LungeSound.Volume = .6
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function windforce(dir, victimTorso)
- if (victimTorso.Parent:FindFirstChild("ForceField") ~= nil) then return end
- if victimTorso:FindFirstChild("WindEffect") == nil then
- local force = Instance.new("BodyVelocity")
- force.Name = "WindEffect"
- force.maxForce = Vector3.new(1e7, 1e7, 1e7)
- force.P = 125
- force.velocity = (dir * 150) + Vector3.new(0, 30,0)
- force.Parent = victimTorso
- game.Debris:AddItem(force, .25)
- end
- 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
- -- final check, make sure sword is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- local d = vCharacter.Torso.CFrame.lookVector
- windforce(Vector3.new(d.x, d.y, d.z), hit.Parent.Torso)
- end
- end
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- game.Debris:AddItem(creator_tag, 1)
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function lunge()
- damage = lunge_damage
- LungeSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Lunge"
- anim.Parent = Tool
- local force = Instance.new("BodyVelocity")
- force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
- force.Parent = Tool.Parent.Torso
- wait(.25)
- swordOut()
- wait(.25)
- force.Parent = nil
- wait(.5)
- swordUp()
- damage = slash_damage
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 0
- 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
- t = r.Stepped:wait()
- if (t - last_attack < .2) then
- lunge()
- else
- attack()
- end
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end,o2)
- end))
- o3.Name = "Handle"
- o3.Parent = o1
- o3.BrickColor = BrickColor.new("Medium blue")
- o3.Reflectance = 0.30000001192093
- o3.Position = Vector3.new(48.0999985, 2.50000191, 149.800018)
- o3.Rotation = Vector3.new(90, -0, -0)
- o3.FormFactor = Enum.FormFactor.Plate
- o3.Size = Vector3.new(1, 0.800000012, 5)
- o3.CFrame = CFrame.new(48.0999985, 2.50000191, 149.800018, 1, 0, -0, 0, 0, -1, 0, 1, -0)
- o3.BottomSurface = Enum.SurfaceType.Smooth
- o3.TopSurface = Enum.SurfaceType.Smooth
- o3.Color = Color3.new(0.431373, 0.6, 0.792157)
- o3.Position = Vector3.new(48.0999985, 2.50000191, 149.800018)
- o4.Parent = o3
- o4.MeshId = "rbxasset://fonts/sword.mesh"
- o4.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- o4.VertexColor = Vector3.new(1, 1, 0)
- o4.MeshType = Enum.MeshType.FileMesh
- o6.Name = "Local Gui"
- o6.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(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(.5)
- 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,o6)
- end))
- mas.Parent = workspace
- mas:MakeJoints()
- local mas1 = mas:GetChildren()
- for i=1,#mas1 do
- mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack
- ypcall(function() mas1[i]:MakeJoints() end)
- end
- mas:Destroy()
- for i=1,#cors do
- coroutine.resume(cors[i])
- end
Add Comment
Please, Sign In to add comment