|
| 25 Jan 2015 06:42 PM |
handle = script.Parent sword = script.Parent.Parent["Iron Sword"] part1=sword.Part1 part2=sword.Part2 part3=sword.Part3 part4=sword.Part4 slash = true
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() slash = true function Slash() sword.GripUp = Vector3.new(1, 1, 0) wait(0.1) sword.GripUp = Vector3.new(3, 1, 0) wait(0.1) sword.GripUp = Vector3.new(5, 1, 0) wait(0.1) sword.GripUp = Vector3.new(7, 1, 0) wait(0.1) sword.GripUp = Vector3.new(4, 1, 0) wait(0.1) sword.GripUp = Vector3.new(3, 1, 0) wait(0.1) sword.GripUp = Vector3.new(2, 1, 0) wait(0.1) sword.GripUp = Vector3.new(1, 1, 0) wait(0.1) sword.GripUp = Vector3.new(0, 1, 0) end
sword.Activated:connect(Slash)
sword.Part1.Touched:connect(function(hit) if slash == false then return end slash = false if hit.ClassName == "Part" and hit.Name ~= "Handle" and hit.Parent.Humanoid then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - sword.Damage.Value wait(0.4) slash = true end end)
sword.Part4.Touched:connect(function(hit) if slash == false then return end slash = false if hit.ClassName == "Part" and hit.Name ~= "Handle" and hit.Parent.Humanoid then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - sword.Damage.Value wait(0.4) slash = true end end)
The last 2 functions only work 0 to several times |
|
|
| Report Abuse |
|
| |
| |
| |