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")
- Sound2 = Instance.new("Sound")
- Script3 = Instance.new("Script")
- Script4 = Instance.new("Script")
- Sound5 = Instance.new("Sound")
- Script6 = Instance.new("Script")
- Script7 = Instance.new("Script")
- Sound8 = Instance.new("Sound")
- Script9 = Instance.new("Script")
- Script10 = Instance.new("Script")
- BoolValue11 = Instance.new("BoolValue")
- Sparkles12 = Instance.new("Sparkles")
- Script13 = Instance.new("Script")
- Script14 = Instance.new("Script")
- Script15 = Instance.new("Script")
- Animation16 = Instance.new("Animation")
- LocalScript17 = Instance.new("LocalScript")
- Animation18 = Instance.new("Animation")
- LocalScript19 = Instance.new("LocalScript")
- Animation20 = Instance.new("Animation")
- Sound21 = Instance.new("Sound")
- Script22 = Instance.new("Script")
- Script23 = Instance.new("Script")
- Animation24 = Instance.new("Animation")
- Part25 = Instance.new("Part")
- BlockMesh26 = Instance.new("BlockMesh")
- BoolValue27 = Instance.new("BoolValue")
- CornerWedgePart28 = Instance.new("CornerWedgePart")
- IntValue29 = Instance.new("IntValue")
- Part30 = Instance.new("Part")
- SpecialMesh31 = Instance.new("SpecialMesh")
- CornerWedgePart32 = Instance.new("CornerWedgePart")
- Animation33 = Instance.new("Animation")
- Animation34 = Instance.new("Animation")
- CornerWedgePart35 = Instance.new("CornerWedgePart")
- CornerWedgePart36 = Instance.new("CornerWedgePart")
- CornerWedgePart37 = Instance.new("CornerWedgePart")
- Animation38 = Instance.new("Animation")
- Animation39 = Instance.new("Animation")
- Script40 = Instance.new("Script")
- Script41 = Instance.new("Script")
- Script42 = Instance.new("Script")
- Animation43 = Instance.new("Animation")
- LocalScript44 = Instance.new("LocalScript")
- Part45 = Instance.new("Part")
- SpecialMesh46 = Instance.new("SpecialMesh")
- ScreenGui47 = Instance.new("ScreenGui")
- Frame48 = Instance.new("Frame")
- Frame49 = Instance.new("Frame")
- Frame50 = Instance.new("Frame")
- TextLabel51 = Instance.new("TextLabel")
- Part52 = Instance.new("Part")
- SpecialMesh53 = Instance.new("SpecialMesh")
- BoolValue54 = Instance.new("BoolValue")
- StringValue55 = Instance.new("StringValue")
- Script56 = Instance.new("Script")
- CornerWedgePart57 = Instance.new("CornerWedgePart")
- CornerWedgePart58 = Instance.new("CornerWedgePart")
- CornerWedgePart59 = Instance.new("CornerWedgePart")
- Part60 = Instance.new("Part")
- SpecialMesh61 = Instance.new("SpecialMesh")
- Part62 = Instance.new("Part")
- SpecialMesh63 = Instance.new("SpecialMesh")
- Script64 = Instance.new("Script")
- Tool0.Name = "ScytheDark"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=204661344"
- Tool0.GripPos = Vector3.new(0, -2, 0)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.BrickColor = BrickColor.new("Dark stone grey")
- Part1.Transparency = 1
- Part1.Rotation = Vector3.new(-87.909996, 19.9200001, -152.449997)
- Part1.Anchored = true
- Part1.CanCollide = false
- Part1.Locked = true
- Part1.FormFactor = Enum.FormFactor.Plate
- Part1.Size = Vector3.new(0.25, 1.10000014, 0.25)
- Part1.CFrame = CFrame.new(45.8666725, 5.47763586, -14.3797054, -0.833579004, 0.434817016, 0.340705484, 0.28499499, -0.189831018, 0.939543545, 0.473206013, 0.880283117, 0.0343184844)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part1.Position = Vector3.new(45.8666725, 5.47763586, -14.3797054)
- Part1.Orientation = Vector3.new(-69.9799957, 84.25, 123.669998)
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Sound2.Name = "SlashSound"
- Sound2.Parent = Part1
- Sound2.Pitch = 1.2000000476837
- Sound2.SoundId = "http://www.roblox.com/asset/?id=197780401"
- Sound2.Volume = 1
- Script3.Name = "SoundScript"
- Script3.Parent = Sound2
- table.insert(cors,sandbox(Script3,function()
- function onTouched(hit)
- wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
- script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script4.Name = "SoundX"
- Script4.Parent = Sound2
- table.insert(cors,sandbox(Script4,function()
- while true do
- for i = 100, 120 do
- script.Parent.Pitch = i/100
- wait()
- end
- for i = 100, 120 do
- script.Parent.Pitch = 2.20-i/100
- wait()
- end
- end
- end))
- Sound5.Name = "SpinSound"
- Sound5.Parent = Part1
- Sound5.Pitch = 1.2000000476837
- Sound5.SoundId = "http://www.roblox.com/asset/?id=156562035"
- Sound5.Volume = 1
- Script6.Name = "SoundX"
- Script6.Parent = Sound5
- table.insert(cors,sandbox(Script6,function()
- while true do
- for i = 100, 120 do
- script.Parent.Pitch = i/100
- wait()
- end
- for i = 100, 120 do
- script.Parent.Pitch = 2.20-i/100
- wait()
- end
- end
- end))
- Script7.Name = "SoundScript"
- Script7.Parent = Sound5
- table.insert(cors,sandbox(Script7,function()
- function onTouched(hit)
- wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
- script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound8.Name = "WhackSound"
- Sound8.Parent = Part1
- Sound8.Pitch = 0.60000002384186
- Sound8.SoundId = "http://www.roblox.com/asset/?id=197780401"
- Script9.Name = "SoundX"
- Script9.Parent = Sound8
- table.insert(cors,sandbox(Script9,function()
- while true do
- for i = 60, 70 do
- script.Parent.Pitch = i/100
- wait()
- end
- for i = 60, 70 do
- script.Parent.Pitch = 1.3-i/100
- wait()
- end
- end
- end))
- Script10.Name = "SoundScript"
- Script10.Parent = Sound8
- table.insert(cors,sandbox(Script10,function()
- function onTouched(hit)
- wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
- script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
- end
- script.Parent.Touched:connect(onTouched)
- end))
- BoolValue11.Name = "Blockable"
- BoolValue11.Parent = Part1
- BoolValue11.Value = true
- Sparkles12.Parent = Part1
- Sparkles12.Color = Color3.new(1.77083, 10.2, 0)
- Sparkles12.Enabled = false
- Sparkles12.SparkleColor = Color3.new(1, 1, 0)
- Sparkles12.Color = Color3.new(1.77083, 10.2, 0)
- Script13.Name = "SuperKatanaScript"
- Script13.Parent = Tool0
- table.insert(cors,sandbox(Script13,function()
- -- Ninja Katana FTW!!
- -- handle to the game service object
- r = game:service("RunService")
- -- Normal damage
- local nonslash_damage = 333
- -- special damage when the Ninja slash occurs
- local slash_damage = 666
- local damage = nonslash_damage
- -- Handle to the tool and its object
- sword = script.Parent.Handle
- Tool = script.Parent
- -- Called when the katana(held by a player) comes in contact with
- -- another humanoid object
- 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)
- wait(1)
- untagHumanoid(humanoid)
- 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
- 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()
- --SlashSound:play()
- if key == "r" then--spin
- local SpinMe = script.SpinAttack:Clone()
- SpinMe.Parent = script.Parent.Parent.Torso
- SpinMe.Disabled = false
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- local debounce = false
- function onActivated()
- if debounce then return end
- debounce = true
- damage = slash_damage
- print("A")
- while Tool.Enabled do wait() end -- necessary to avoid debouncing conflicts between this script and LocalKatanaScript!
- attack()
- while not Tool.Enabled do wait() end -- necessary to avoid debouncing conflicts between this script and LocalKatanaScript!
- damage = nonslash_damage
- print("B")
- debounce = false
- end
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end))
- Script14.Name = "SpinAttack"
- Script14.Parent = Script13
- Script14.Disabled = true
- table.insert(cors,sandbox(Script14,function()
- local torso = script.Parent
- script.ForceClean.Disabled = false
- if torso ~= nil then
- local spinForce = Instance.new("BodyAngularVelocity")
- spinForce.Name = "DDD"
- spinForce.P = 5000000
- spinForce.angularvelocity = Vector3.new(0,20,0)
- spinForce.maxTorque = Vector3.new(spinForce.P,spinForce.P,spinForce.P)
- spinForce.Parent = torso
- debris:AddItem(spinForce, 1)
- wait(1)
- end
- end))
- Script15.Name = "ForceClean"
- Script15.Parent = Script14
- Script15.Disabled = true
- table.insert(cors,sandbox(Script15,function()
- wait(.75)
- script.Parent.Parent.DDD:remove()
- script.Parent:remove()
- end))
- Animation16.Name = "Ninja Dash"
- Animation16.Parent = Tool0
- Animation16.AnimationId = "http://www.roblox.com/Asset?ID=45828430"
- LocalScript17.Name = "LocalKatanaScript"
- LocalScript17.Parent = Tool0
- table.insert(cors,sandbox(LocalScript17,function()
- local Tool = script.Parent
- Tool.Enabled = true
- local r = game:GetService("RunService")
- --invisible forces to move player around
- --body velocity
- local newBV = nil
- --body gyro
- local newBG = nil
- --body angualar velocity
- local newBAV = nil
- --body position
- local newBP = nil
- local slashSound = Tool.Handle.SlashSound
- local spinSound = Tool.Handle.SpinSound
- local whackSound = Tool.Handle.WhackSound
- --hum = local player's humanoid model
- --torso = local player's torso
- function slashIt(hum, torso)
- nsAnim = hum:LoadAnimation(Tool["Ninja Slash"])
- if nsAnim == nil then Tool.Enabled = true return end
- nsAnim:Play()
- --where the player's torso is pointing
- if game.Players.NumPlayers>1 then
- target = getNearestPlayer().Character.Torso.CFrame.p
- else target = hum.TargetPoint end
- local dir = (target - torso.Position) * Vector3.new(1, 0, 1)
- newBV = nil
- if dir.magnitude > .01 then
- -- make 'em dash forwards too
- dir = dir.unit
- newBV = Instance.new("BodyVelocity")
- newBV.P = 100000
- newBV.maxForce = Vector3.new(newBV.P, 0, newBV.P)
- newBV.velocity = dir * 50
- newBV.Parent = torso
- torso.CFrame = CFrame.new(torso.Position, target * Vector3.new(1, 0, 1) + Vector3.new(0, torso.Position.Y, 0))
- end
- wait(.5)
- slashSound:Play()
- if newBV ~= nil then newBV:remove() end
- wait(.5)
- end
- function blowIt(iterations)
- nsAnim = hum:LoadAnimation(Tool["dualslash2"])
- nsAnim:Play()
- wait(.75)
- --create line explosion
- local exp_loc=Tool.Handle.CFrame.p
- --local exp_dir= Vector3.new(Tool.Parent.Torso.CFrame.lookVector)
- local exp_dir= torso.CFrame.lookVector
- Tool.lineExplosion:Play()
- for i=2, iterations, 1 do
- local explosion = Instance.new('Explosion', Workspace)
- explosion.ExplosionType = Enum.ExplosionType.CratersAndDebris
- explosion.Position=exp_loc+(exp_dir*(i*10))--test
- explosion.BlastPressure = 1
- explosion.BlastRadius = 5
- wait(.05)
- end
- end
- --returns closest player object
- function getNearestPlayer()
- local nearest=nil
- local nearest_distance=0
- local tdist = 0
- local parent_pos= game.Players.LocalPlayer.Character.Torso.CFrame.p
- local player= nil
- for _, player in pairs(game.Players:GetPlayers()) do
- print (player)
- if player.Character and player~=game.Players.LocalPlayer then
- tdist= (player.Character.Torso.CFrame.p-parent_pos).magnitude
- if nearest==nil or tdist<nearest_distance then
- nearest_distance=tdist
- nearest=player
- end
- end
- end
- return nearest
- end
- --hum = local player's humanoid model
- --torso = local player's torso
- function dashIt(hum, torso)
- ndAnim = hum:LoadAnimation(Tool["Ninja Dash"])
- if ndAnim == nil then Tool.Enabled = true return end
- if game.Players.NumPlayers>1 then
- target = getNearestPlayer().Character.Torso.CFrame.p
- else target = hum.TargetPoint end
- print (target)
- local dir = (target - torso.Position) * Vector3.new(1, 0, 1)
- if dir.magnitude < .01 then Tool.Enabled = true return end
- dir = dir.unit
- newBG = Instance.new("BodyGyro")
- newBG.P = 30000
- newBG.maxTorque = Vector3.new(newBG.P, newBG.P, newBG.P)
- --newBG.cframe = torso.CFrame * CFrame.Angles(-math.pi/2, 0, 0)
- local torsoPosition = torso.Position
- newBG.cframe = CFrame.new(torsoPosition, target*Vector3.new(1,0,1) + Vector3.new(0, torsoPosition.Y, 0) ) * CFrame.Angles(-math.pi/2, 0, 0)
- newBG.Parent = torso
- newBP = Instance.new("BodyPosition")
- newBP.P = 100000
- newBP.maxForce = Vector3.new(newBP.P, newBP.P, newBP.P)
- newBP.position = torsoPosition + Vector3.new(0, 1.5, 0)
- newBP.Parent = torso
- newBAV = Instance.new("BodyAngularVelocity")
- newBAV.P = 100000
- newBAV.maxTorque = Vector3.new(newBAV.P, newBAV.P, newBAV.P)
- newBV = Instance.new("BodyVelocity")
- newBV.P = 100000
- newBV.maxForce = Vector3.new(newBV.P, 0, newBV.P)
- newBV.velocity = dir * 64
- ndAnim:Play()
- wait(.5)
- spinSound:Play()
- newBG.maxTorque = Vector3.new(newBP.P, 0, newBP.P)
- newBP.maxForce = Vector3.new(0, newBP.P, 0)
- newBV.Parent = torso
- newBAV.angularvelocity = torso.CFrame:vectorToWorldSpace(Vector3.new(0, -30, 0))
- hum.Sit = true
- newBAV.Parent = torso
- wait(1)
- -- testing for fun
- -- for i = 1, 50 do
- --target = hum.TargetPoint
- --newdir = (target - torso.Position) * Vector3.new(1, 0, 1)
- --if newdir.magnitude > .01 then
- -- dir = newdir
- --dir = dir.unit
- --newBV.velocity = dir * 32
- --end
- --newBG.cframe = CFrame.new(torso.Position, target*Vector3.new(1,0,1) + Vector3.new(0, torso.Position.Y, 0) ) * CFrame.Angles(-math.pi/2, 0, 0)
- --wait(.1)
- --end
- -- end of testing for fun
- --for i = 1, 3 do
- -- ndAnim:Play()
- --wait(2)
- --end
- hum.Sit = false
- if newBAV ~= nil then newBAV:remove() end
- if newBP ~= nil then newBP:remove() end
- if newBV ~= nil then newBV:remove() end
- if newBG ~= nil then newBG.cframe = CFrame.new(torsoPosition, target*Vector3.new(1,0,1) + Vector3.new(0, torsoPosition.Y, 0) ) end
- if newBG ~= nil then newBG.maxTorque = Vector3.new(newBG.P, newBG.P, newBG.P) end
- spinSound:Stop()
- wait(.25)
- if newBG ~= nil then newBG:remove() end
- end
- local ultra_step_num=-1
- --time last key was pressed
- local lastWDown = 0
- local lastADown = 0
- local lastDDown = 0
- --time that dash was activated(see onKeyDown)
- local dashTime = 0
- --time of last slatsh effect
- local lastSlash = 0
- local lastSuperStrike = 0
- local amAnimating = false
- function onActivated()
- --cant find vChar's declaration??
- --vChar=player?
- vChar = Tool.Parent
- if vChar == nil then return end
- --hum = humanoid(player model)
- hum = vChar:FindFirstChild("Humanoid")
- if hum == nil then return end
- --if not Tool.Enabled then return end
- if amAnimating then return end
- Tool.Enabled = false
- amAnimating = true
- torso = vChar:FindFirstChild("Torso")
- if torso == nil then Tool.Enabled = true return end
- t = r.Stepped:wait()
- if t - lastSuperStrike < .2 then
- blowIt(10)
- wait(.5) -- reload time
- amAnimating = false
- elseif t - dashTime < .2 then --special double click
- -- dash attack
- dashIt(hum, torso)
- wait(.5) -- reload time
- amAnimating = false
- elseif t - lastSlash < .2 then --normal double click
- -- slash attack
- slashIt(hum, torso)
- --wait(1)
- amAnimating = false
- --wait(.5) -- reload time
- else
- -- normal attack
- whackSound:Play()
- lastSlash = t
- amAnimating = false -- here must be before the wait, to allow for double-clix
- wait(.5)
- end
- if not amAnimating then Tool.Enabled = true end
- end
- local keyConnection = nil
- local keytime = 0
- function onKeyDown(key)
- keytime = r.Stepped:wait()
- if key:lower() == "q" then
- if (keytime - lastWDown < 1) then dashTime = keytime end
- lastWDown = keytime
- elseif key:lower() == "r" then
- lastADown = keytime
- --[[elseif key:lower() == "r" then
- lastDDown = keytime
- if lastDDown-lastADown < 1 and lastWDown>lastADown then
- print("SUPER STRIKE")
- lastSuperStrike=keytime]]
- elseif key:lower() == "e" then
- lastSuperStrike=keytime
- end
- end
- --end
- function onEquippedLocal(mouse)
- slashSound.Volume = 1
- spinSound.Volume = 1
- whackSound.Volume = 1
- keyConnection = mouse.KeyDown:connect(onKeyDown)
- vChar = Tool.Parent
- if vChar == nil then return end
- --hum = humanoid(player model)
- hum = vChar:FindFirstChild("Humanoid")
- nsAnim = hum:LoadAnimation(Tool.swordPumpUp)
- nsAnim:Play()
- nsAnim:AdjustSpeed(3)
- end
- function onUnequippedLocal()
- if keyConnection ~= nil then keyConnection:disconnect() end
- if newBV ~= nil then newBV:remove() end
- if newBG ~= nil then newBG:remove() end
- if newBAV ~= nil then newBAV:remove() end
- if newBP ~= nil then newBP:remove() end
- slashSound.Volume = 0
- spinSound.Volume = 0
- whackSound.Volume = 0
- end
- Tool.Equipped:connect(onEquippedLocal)
- Tool.Unequipped:connect(onUnequippedLocal)
- Tool.Activated:connect(onActivated)
- end))
- Animation18.Name = "Ninja Slash"
- Animation18.Parent = Tool0
- Animation18.AnimationId = "http://www.roblox.com/Asset?ID=45873069"
- LocalScript19.Name = "Local Gui"
- LocalScript19.Parent = Tool0
- table.insert(cors,sandbox(LocalScript19,function()
- local Tool = script.Parent;
- local stillEquipped = true
- function onEquippedLocal(mouse)
- stillEquipped = true
- if mouse == nil then
- print("Mouse not found")
- return
- end
- while stillEquipped do
- print("Setting Mouse to Go")
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- while Tool.Enabled and stillEquipped do
- wait(.01)
- end
- print("Setting Mouse To Wait")
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- while not Tool.Enabled and stillEquipped do
- wait(.01)
- end
- end
- end
- function onUnequippedLocal()
- stillEquipped = false
- end
- Tool.Equipped:connect(onEquippedLocal)
- Tool.Unequipped:connect(onUnequippedLocal)
- end))
- Animation20.Name = "dualslash2"
- Animation20.Parent = Tool0
- Animation20.AnimationId = "http://www.roblox.com/Asset?ID=85576403"
- Sound21.Name = "lineExplosion"
- Sound21.Parent = Tool0
- Sound21.Pitch = 0.60000002384186
- Sound21.SoundId = "http://www.roblox.com/Asset?ID=185722889"
- Script22.Name = "SoundScript"
- Script22.Parent = Sound21
- table.insert(cors,sandbox(Script22,function()
- function onTouched(hit)
- wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
- script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script23.Name = "SoundX"
- Script23.Parent = Sound21
- table.insert(cors,sandbox(Script23,function()
- while true do
- for i = 60, 80 do
- script.Parent.Pitch = i/100
- wait()
- end
- for i = 60, 80 do
- script.Parent.Pitch = 1.4-i/100
- wait()
- end
- end
- end))
- Animation24.Name = "swordPumpUp"
- Animation24.Parent = Tool0
- Animation24.AnimationId = "http://www.roblox.com/Asset?ID=85723345"
- Part25.Name = "HX"
- Part25.Parent = Tool0
- Part25.Material = Enum.Material.Fabric
- Part25.BrickColor = BrickColor.new("Really black")
- Part25.Rotation = Vector3.new(96.4599991, -14.3400002, 90.2799988)
- Part25.FormFactor = Enum.FormFactor.Custom
- Part25.Size = Vector3.new(0.0500000045, 0.155000001, 0.155000001)
- Part25.CFrame = CFrame.new(45.6886292, 5.63382578, -14.5855122, -0.00465982407, -0.968833387, -0.247669607, -0.111327291, 0.246635318, -0.962692618, 0.993772805, 0.0230864156, -0.109006912)
- Part25.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part25.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part25.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part25.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part25.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part25.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part25.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part25.Position = Vector3.new(45.6886292, 5.63382578, -14.5855122)
- Part25.Orientation = Vector3.new(74.2999954, -113.759995, -24.289999)
- Part25.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- BlockMesh26.Parent = Part25
- BlockMesh26.Scale = Vector3.new(0.25, 1, 1)
- BlockMesh26.Scale = Vector3.new(0.25, 1, 1)
- BoolValue27.Name = "MouseDown"
- BoolValue27.Parent = Tool0
- CornerWedgePart28.Parent = Tool0
- CornerWedgePart28.Material = Enum.Material.Ice
- CornerWedgePart28.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart28.Rotation = Vector3.new(163.399994, -5.46000004, -136.720001)
- CornerWedgePart28.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart28.CFrame = CFrame.new(46.0641403, 6.07490969, -13.147522, -0.72467196, 0.682498157, -0.0951149613, 0.676821768, 0.679019213, -0.284332901, -0.129471824, -0.270423949, -0.953995645)
- CornerWedgePart28.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart28.Position = Vector3.new(46.0641403, 6.07490969, -13.147522)
- CornerWedgePart28.Orientation = Vector3.new(16.5200005, -174.309998, 44.9099998)
- CornerWedgePart28.Color = Color3.new(0.431373, 0.6, 0.792157)
- IntValue29.Name = "WeaponSpeed"
- IntValue29.Parent = Tool0
- IntValue29.Value = 98
- Part30.Name = "FakeHandle"
- Part30.Parent = Tool0
- Part30.Material = Enum.Material.Fabric
- Part30.BrickColor = BrickColor.new("Dark stone grey")
- Part30.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
- Part30.FormFactor = Enum.FormFactor.Custom
- Part30.Size = Vector3.new(0.5200001, 0.10050001, 0.10050001)
- Part30.CFrame = CFrame.new(45.6853752, 5.56908894, -14.7886391, 0.0951149762, -0.968833447, -0.228724718, 0.284332931, 0.246635154, -0.926458716, 0.953995764, 0.0230861325, 0.29892993)
- Part30.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part30.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part30.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part30.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part30.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part30.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part30.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part30.Position = Vector3.new(45.6853752, 5.56908894, -14.7886391)
- Part30.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
- Part30.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh31.Parent = Part30
- SpecialMesh31.MeshType = Enum.MeshType.Cylinder
- CornerWedgePart32.Parent = Tool0
- CornerWedgePart32.Material = Enum.Material.Ice
- CornerWedgePart32.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart32.Rotation = Vector3.new(-100.829994, -46.4399986, -82.0699997)
- CornerWedgePart32.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart32.CFrame = CFrame.new(45.9620438, 6.17026043, -13.1657629, 0.0951149613, 0.682498157, -0.72467196, 0.284332901, 0.679019213, 0.676821768, 0.953995645, -0.270423949, -0.129471824)
- CornerWedgePart32.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart32.Position = Vector3.new(45.9620438, 6.17026043, -13.1657629)
- CornerWedgePart32.Orientation = Vector3.new(-42.5999985, -100.129997, 22.7199993)
- CornerWedgePart32.Color = Color3.new(0.431373, 0.6, 0.792157)
- Animation33.Name = "Stab1"
- Animation33.Parent = Tool0
- Animation33.AnimationId = "http://www.roblox.com/Asset?ID=48146273"
- Animation34.Name = "Equip"
- Animation34.Parent = Tool0
- Animation34.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
- CornerWedgePart35.Parent = Tool0
- CornerWedgePart35.Material = Enum.Material.Ice
- CornerWedgePart35.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart35.Rotation = Vector3.new(163.399994, -5.46000004, 43.2799988)
- CornerWedgePart35.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart35.CFrame = CFrame.new(45.7216682, 5.93110895, -13.0705194, 0.72467196, -0.682498157, -0.0951149613, -0.676821768, -0.679019213, -0.284332901, 0.129471824, 0.270423949, -0.953995645)
- CornerWedgePart35.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart35.Position = Vector3.new(45.7216682, 5.93110895, -13.0705194)
- CornerWedgePart35.Orientation = Vector3.new(16.5200005, -174.309998, -135.089996)
- CornerWedgePart35.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart36.Parent = Tool0
- CornerWedgePart36.Material = Enum.Material.Ice
- CornerWedgePart36.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart36.Rotation = Vector3.new(79.1699982, 46.4399986, -97.9300003)
- CornerWedgePart36.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart36.CFrame = CFrame.new(46.0775337, 6.11496639, -13.0131226, -0.0951149613, 0.682498157, 0.72467196, -0.284332901, 0.679019213, -0.676821768, -0.953995645, -0.270423949, 0.129471824)
- CornerWedgePart36.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart36.Position = Vector3.new(46.0775337, 6.11496639, -13.0131226)
- CornerWedgePart36.Orientation = Vector3.new(42.5999985, 79.8699951, -22.7199993)
- CornerWedgePart36.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart37.Parent = Tool0
- CornerWedgePart37.Material = Enum.Material.Ice
- CornerWedgePart37.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart37.Rotation = Vector3.new(-16.6000004, 5.46000004, -43.2799988)
- CornerWedgePart37.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart37.CFrame = CFrame.new(45.9754448, 6.21031809, -13.0313625, 0.72467196, 0.682498157, 0.0951149613, -0.676821768, 0.679019213, 0.284332901, 0.129471824, -0.270423949, 0.953995645)
- CornerWedgePart37.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart37.Position = Vector3.new(45.9754448, 6.21031809, -13.0313625)
- CornerWedgePart37.Orientation = Vector3.new(-16.5200005, 5.69000006, -44.9099998)
- CornerWedgePart37.Color = Color3.new(0.431373, 0.6, 0.792157)
- Animation38.Name = "Stab2"
- Animation38.Parent = Tool0
- Animation38.AnimationId = "http://www.roblox.com/Asset?ID=48146273"
- Animation39.Name = "Hold"
- Animation39.Parent = Tool0
- Animation39.AnimationId = "http://www.roblox.com/Asset?ID=48146273"
- Script40.Name = "WeaponScript"
- Script40.Parent = Tool0
- table.insert(cors,sandbox(Script40,function()
- local tool = script.Parent
- tool.Equipped:connect(function(mouse)
- mouse.KeyDown:connect(function(key)
- if key == "r" then--spin
- local SpinMe = script.SpinAttack:Clone()
- SpinMe.Parent = script.Parent.Parent.Torso
- SpinMe.Disabled = false
- local SpinMe2 = Instance.new("Sound")
- SpinMe2.Parent = script.Parent.Handle
- SpinMe2.Pitch = .8
- SpinMe2.Volume = 1
- SpinMe2.SoundId = "http://www.roblox.com/asset/?id=158508669"
- SpinMe2.PlayOnRemove = true
- SpinMe2:remove()
- wait(2)
- end
- end)
- end)
- end))
- Script41.Name = "SpinAttack"
- Script41.Parent = Script40
- Script41.Disabled = true
- table.insert(cors,sandbox(Script41,function()
- torso = script.Parent
- script.ForceClean.Disabled=false
- local spinForce = Instance.new("BodyAngularVelocity")
- spinForce.Name = "DDD"
- spinForce.P = 5000000
- spinForce.angularvelocity = Vector3.new(0,20,0)
- spinForce.maxTorque = Vector3.new(spinForce.P,spinForce.P,spinForce.P)
- spinForce.Parent = torso
- debris:AddItem(spinForce, 1)
- wait(1)
- end))
- Script42.Name = "ForceClean"
- Script42.Parent = Script41
- Script42.Disabled = true
- table.insert(cors,sandbox(Script42,function()
- wait(.75)
- script.Parent.Parent.DDD:remove()
- script.Parent:remove()
- end))
- Animation43.Name = "LeftSlash"
- Animation43.Parent = Tool0
- Animation43.AnimationId = "http://www.roblox.com/Asset?ID=74894663"
- LocalScript44.Parent = Tool0
- table.insert(cors,sandbox(LocalScript44,function()
- sp=script.Parent
- function waitfor(a,b)
- while a:FindFirstChild(b)==nil do
- a.ChildAdded:wait()
- end
- return a:FindFirstChild(b)
- end
- reloading=waitfor(sp,"Reloading")
- down=waitfor(sp,"MouseDown")
- runanim=waitfor(sp,"RunAnim")
- animspeed=1.2 --lower number is slower
- equipspeed=1.5
- originalgrip=CFrame.new(0,0,-1.1,0,0,1,1,0,0,0,1,0)
- currentgrip=originalgrip
- function swordUp()
- currentgrip=originalgrip
- sp.Grip=currentgrip
- end
- function swordOut()
- currentgrip=originalgrip*CFrame.Angles(math.pi/4,.4,0)
- sp.Grip=currentgrip
- end
- function spinsword(spintime)
- delay(0,function()
- local startspin=tick()
- local endspin=startspin+spintime
- while tick()<endspin do
- sp.Grip=currentgrip*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
- wait()
- end
- sp.Grip=currentgrip
- end)
- end
- function update(mouse)
- if mouse~=nil then
- if reloading.Value then
- mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
- else
- mouse.Icon="rbxasset://textures\\GunCursor.png"
- end
- end
- end
- runanim.Changed:connect(function()
- local h=sp.Parent:FindFirstChild("Humanoid")
- local t=sp.Parent:FindFirstChild("Torso")
- local anim=sp:FindFirstChild(runanim.Value)
- if anim and t and h then
- local theanim=h:LoadAnimation(anim)
- if theanim and h.Health>0 then
- theanim:Play(nil,nil,animspeed)
- end
- end
- end)
- function Equipped(mouse)
- if mouse~=nil then
- update(mouse)
- reloading.Changed:connect(function()
- update(mouse)
- end)
- mouse.Button1Down:connect(function()
- down.Value=true
- end)
- mouse.Button1Up:connect(function()
- down.Value=false
- end)
- local h=sp.Parent:FindFirstChild("Humanoid")
- local t=sp.Parent:FindFirstChild("Torso")
- if t and h then
- local equipanim=sp:FindFirstChild("Equip")
- if equipanim~=nil then
- local EquipAnim=h:LoadAnimation(equipanim)
- if EquipAnim and h.Health>0 then
- EquipAnim:Play(nil,nil,equipspeed)
- end
- end
- local holdanim=sp:FindFirstChild("Hold")
- if holdanim~=nil then
- if HoldAnim then
- HoldAnim:Stop()
- end
- HoldAnim=h:LoadAnimation(holdanim)
- if HoldAnim and h.Health>0 then
- HoldAnim:Play()
- end
- end
- end
- end
- end
- function Unequipped()
- down.Value=false
- if HoldAnim then
- HoldAnim:Stop()
- end
- end
- sp.Equipped:connect(Equipped)
- sp.Unequipped:connect(Unequipped)
- end))
- Part45.Parent = Tool0
- Part45.Material = Enum.Material.Metal
- Part45.BrickColor = BrickColor.new("Black")
- Part45.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
- Part45.FormFactor = Enum.FormFactor.Custom
- Part45.Size = Vector3.new(0.62500006, 0.125, 0.125)
- Part45.CFrame = CFrame.new(45.792614, 5.88966942, -13.7130146, 0.0951149762, -0.968833447, -0.228724718, 0.284332931, 0.246635154, -0.926458716, 0.953995764, 0.0230861325, 0.29892993)
- Part45.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part45.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part45.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part45.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part45.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part45.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part45.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part45.Position = Vector3.new(45.792614, 5.88966942, -13.7130146)
- Part45.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
- Part45.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh46.Parent = Part45
- SpecialMesh46.MeshType = Enum.MeshType.Cylinder
- ScreenGui47.Name = "WeaponHud"
- ScreenGui47.Parent = Tool0
- Frame48.Name = "Bar"
- Frame48.Parent = ScreenGui47
- Frame48.Size = UDim2.new(0, 200, 0, 40)
- Frame48.Style = Enum.FrameStyle.RobloxRound
- Frame48.Position = UDim2.new(0.5, -100, 1, -160)
- Frame48.Visible = false
- Frame48.ZIndex = 4
- Frame49.Name = "Fill"
- Frame49.Parent = Frame48
- Frame49.Size = UDim2.new(1, 0, 1, 0)
- Frame49.BackgroundColor3 = Color3.new(0, 1, 0)
- Frame49.BorderSizePixel = 0
- Frame49.ZIndex = 5
- Frame50.Name = "Backing"
- Frame50.Parent = Frame48
- Frame50.Size = UDim2.new(1, 0, 1, 0)
- Frame50.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame50.BorderSizePixel = 0
- Frame50.ZIndex = 4
- TextLabel51.Name = "WeaponName"
- TextLabel51.Parent = ScreenGui47
- TextLabel51.Transparency = 1
- TextLabel51.Size = UDim2.new(0, 400, 0, 20)
- TextLabel51.Text = "Dagger"
- TextLabel51.Position = UDim2.new(0.5, -200, 1, -185)
- TextLabel51.Visible = false
- TextLabel51.BackgroundTransparency = 1
- TextLabel51.BorderSizePixel = 0
- TextLabel51.ZIndex = 4
- TextLabel51.ClipsDescendants = true
- TextLabel51.Font = Enum.Font.ArialBold
- TextLabel51.FontSize = Enum.FontSize.Size18
- TextLabel51.TextColor3 = Color3.new(0, 0, 0)
- TextLabel51.TextStrokeColor3 = Color3.new(0.698039, 0.698039, 0.698039)
- TextLabel51.TextTransparency = 0.20000000298023
- Part52.Parent = Tool0
- Part52.Material = Enum.Material.Metal
- Part52.BrickColor = BrickColor.new("Black")
- Part52.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
- Part52.FormFactor = Enum.FormFactor.Custom
- Part52.Size = Vector3.new(0.0825000033, 0.0825000033, 0.0825000033)
- Part52.CFrame = CFrame.new(45.6033363, 5.3238492, -15.6114674, 0.0951151401, -0.968833447, -0.228724658, 0.284334123, 0.246635124, -0.926458538, 0.953995466, 0.0230860114, 0.298931152)
- Part52.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part52.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part52.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part52.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part52.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part52.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part52.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part52.Position = Vector3.new(45.6033363, 5.3238492, -15.6114674)
- Part52.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
- Part52.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh53.Parent = Part52
- SpecialMesh53.MeshType = Enum.MeshType.Sphere
- BoolValue54.Name = "Reloading"
- BoolValue54.Parent = Tool0
- StringValue55.Name = "RunAnim"
- StringValue55.Parent = Tool0
- Script56.Parent = Tool0
- table.insert(cors,sandbox(Script56,function()
- sp=script.Parent
- damage=500 --Change damage value if 'ya want.
- damagewindow=1 --after clicking, how long does the player have to hit the opponent wioth their weapon to deal damage
- swingrate=.4
- clashsounds={154020979,155827029,134049906}
- swooshsounds={197780401,168803294}
- hitsounds={180083286,180083298,133052541}
- anims={"Stab1","Stab2","LeftSlash"}
- ready=false
- equipped=false
- rate=1/30
- lastswing=0
- function waitfor(a,b)
- while a:FindFirstChild(b)==nil do
- a.ChildAdded:wait()
- end
- return a:FindFirstChild(b)
- end
- reloading=waitfor(sp,"Reloading")
- down=waitfor(sp,"MouseDown")
- runanim=waitfor(sp,"RunAnim")
- sparkles=waitfor(sp.Handle,"Sparkles")
- debris=game:getService("Debris")
- weaponhud=waitfor(sp,"WeaponHud")
- weaponnametag=waitfor(weaponhud,"WeaponName")
- guibar=waitfor(weaponhud,"Bar")
- guibarfill=waitfor(guibar,"Fill")
- weaponnametag.Text=sp.Name
- function runsound(id,volume)
- local volume=volume or 1
- local sound=Instance.new("Sound")
- sound.Looped=false
- sound.Pitch=1.35
- sound.SoundId="http://www.roblox.com/asset/?id="..tostring(id)
- sound.PlayOnRemove=false
- sound.Volume=volume
- debris:AddItem(sound,3)
- sound.Parent=sp.Handle
- wait()
- sound:Play()
- end
- function billboard(pos,text,time,color)
- local pos=pos or Vector3.new(0,0,0)
- local text=text or "Hello World!"
- local time=time or 2
- local color=color or Color3.new(1,0,0)
- local pos=pos+Vector3.new(0,5,0)
- local ep=Instance.new("Part")
- ep.Name="Effect"
- ep.formFactor="Custom"
- ep.Size=Vector3.new(0,0,0)
- ep.TopSurface="Smooth"
- ep.BottomSurface="Smooth"
- ep.CFrame=CFrame.new(pos)
- ep.Anchored=true
- ep.CanCollide=false
- ep.Transparency=1
- local bb=Instance.new("BillboardGui")
- bb.Size=UDim2.new(3,0,3,0)
- bb.Adornee=ep
- bb.Active=false
- local tl=Instance.new("TextLabel")
- tl.BackgroundTransparency=1
- tl.Size=UDim2.new(1,0,1,0)
- tl.Text=text
- tl.TextColor3=color
- tl.TextScaled=true
- tl.Font="ArialBold"
- tl.Visible=false
- tl.Parent=bb
- bb.Parent=ep
- debris:AddItem(ep,time+.1)
- ep.Parent=game.Workspace
- delay(0,function()
- local frames=time/rate
- for frame=1,frames do
- wait(rate)
- local percent=frame/frames
- ep.CFrame=CFrame.new(pos)+Vector3.new(0,5*percent,0)
- tl.TextTransparency=percent
- end
- ep:remove()
- end)
- end
- function makeblood(part)
- --[[
- if part then
- local b=Instance.new("Part")
- b.BrickColor=BrickColor.new("Bright red")
- b.formFactor="Custom"
- b.Transparency=math.random(0,1)*.5
- if math.random()<.5 then
- b.CanCollide=false
- else
- b.CanCollide=true
- end
- b.TopSurface="Smooth"
- b.BottomSurface="Smooth"
- b.Size=Vector3.new(.2*math.random(1,5),.2*math.random(1,5),.2*math.random(1,5))
- b.Velocity=part.Velocity+(Vector3.new((math.random()-.5),(math.random()-.5),(math.random()-.5))*30)
- b.RotVelocity=part.RotVelocity+(Vector3.new((math.random()-.5),(math.random()-.5),(math.random()-.5))*20)
- b.CFrame=part.CFrame*CFrame.new((math.random()-.5)*3,(math.random()-.5)*3,(math.random()-.5)*3)*CFrame.Angles(math.pi*2*math.random(),math.pi*2*math.random(),math.pi*2*math.random())
- debris:AddItem(b,math.random()*4)
- b.Parent=game.Workspace
- end
- --]]
- end
- sp.Handle.Touched:connect(function(hit)
- if ready and equipped and hit and hit.Parent~=nil and hit:IsDescendantOf(sp.Parent)==false and string.lower(string.sub(hit.Name,1,6))~="effect" and (tick()-lastswing)<=damagewindow then
- if hit:FindFirstChild("CanBlock") and sp.Handle:FindFirstChild("Blockable") then
- ready=false
- runsound(clashsounds[math.random(1,#clashsounds)])
- sparkles.Enabled=true
- delay(.2,function()
- sparkles.Enabled=false
- end)
- billboard(sp.Handle.Position,"Block",2,Color3.new(1,1,0))
- end
- local mh=sp.Parent:FindFirstChild("Humanoid")
- local eh=hit.Parent:FindFirstChild("Humanoid")
- local ra=sp.Parent:FindFirstChild("Right Arm")
- local plr=game.Players:GetPlayerFromCharacter(sp.Parent)
- if mh and eh and eh~=mh and mh.Health>0 and eh.Health>0 and ra and plr~=nil then
- if not plr.Neutral then
- local eplr=game.Players:GetPlayerFromCharacter(eh.Parent)
- if eplr~=nil and eplr.Neutral==false and eplr.TeamColor==plr.TeamColor then
- return --No team killing
- end
- end
- ready=false
- for i,v in ipairs(eh:GetChildren()) do
- if v.Name=="creator" then
- v:remove()
- end
- end
- local creator=Instance.new("ObjectValue")
- creator.Name="creator"
- creator.Value=plr
- creator.Parent=eh
- debris:AddItem(creator,1)
- local localdamage=math.floor(damage*(.9+(math.random()*.2)))
- eh:TakeDamage(localdamage)
- billboard(hit.Position,"-"..tostring(localdamage))
- runsound(hitsounds[math.random(1,#hitsounds)])
- local bloodeffects=math.ceil(localdamage/10)
- for i=1,math.random(bloodeffects-1,bloodeffects+1) do
- --[[if math.random()<.5 then
- makeblood(sp.Handle)
- else]]
- makeblood(hit)
- --end
- end
- end
- end
- end)
- function Activate()
- if equipped and (tick()-lastswing)>=swingrate then
- ready=true
- reloading.Value=true
- runsound(swooshsounds[math.random(1,#swooshsounds)],.5)
- newanim=anims[math.random(1,#anims)]
- while newanim==runanim.Value do
- newanim=anims[math.random(1,#anims)]
- end
- runanim.Value=newanim
- lastswing=tick()
- updategui()
- wait(swingrate)
- reloading.Value=false
- if down.Value then
- Activate()
- end
- end
- end
- down.Changed:connect(function()
- if down.Value then
- Activate()
- end
- end)
- function updategui()
- local swingpercent=math.min((tick()-lastswing)/swingrate,1)
- if swingpercent<.5 then --fade from red to yellow then to green
- guibarfill.BackgroundColor3=Color3.new(1,swingpercent*2,0)
- else
- guibarfill.BackgroundColor3=Color3.new(1-((swingpercent-.5)/.5),1,0)
- end
- guibarfill.Size=UDim2.new(swingpercent,0,1,0)
- end
- sp.Equipped:connect(function(mouse)
- lastswing=tick()
- updategui()
- reloading.Value=true
- ready=false
- equipped=true
- delay(0,function() --HAAB (Hacking around a bug)
- local plr=game.Players:GetPlayerFromCharacter(sp.Parent)
- if plr~=nil then
- local plrgui=plr:FindFirstChild("PlayerGui")
- if plrgui~=nil and weaponhud~=nil then
- weaponhud.Parent=plrgui
- while equipped do
- updategui()
- wait(rate)
- end
- end
- end
- end)
- wait(swingrate)
- reloading.Value=false
- if down.Value then
- Activate()
- end
- end)
- sp.Unequipped:connect(function()
- ready=false
- equipped=false
- delay(0,function() --HAAB
- weaponhud.Parent=sp
- end)
- end)
- end))
- CornerWedgePart57.Parent = Tool0
- CornerWedgePart57.Material = Enum.Material.Ice
- CornerWedgePart57.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart57.Rotation = Vector3.new(-16.6000004, 5.46000004, 136.720001)
- CornerWedgePart57.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart57.CFrame = CFrame.new(45.8371544, 5.87581348, -12.9178791, -0.72467196, -0.682498157, 0.0951149613, 0.676821768, -0.679019213, 0.284332901, -0.129471824, 0.270423949, 0.953995645)
- CornerWedgePart57.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart57.Position = Vector3.new(45.8371544, 5.87581348, -12.9178791)
- CornerWedgePart57.Orientation = Vector3.new(-16.5200005, 5.69000006, 135.089996)
- CornerWedgePart57.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart58.Parent = Tool0
- CornerWedgePart58.Material = Enum.Material.Ice
- CornerWedgePart58.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart58.Rotation = Vector3.new(79.1699982, 46.4399986, 82.0699997)
- CornerWedgePart58.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart58.CFrame = CFrame.new(45.8237572, 5.83575726, -13.0522785, 0.0951149613, -0.682498157, 0.72467196, 0.284332901, -0.679019213, -0.676821768, 0.953995645, 0.270423949, 0.129471824)
- CornerWedgePart58.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart58.Position = Vector3.new(45.8237572, 5.83575726, -13.0522785)
- CornerWedgePart58.Orientation = Vector3.new(42.5999985, 79.8699951, 157.279999)
- CornerWedgePart58.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart59.Parent = Tool0
- CornerWedgePart59.Material = Enum.Material.Ice
- CornerWedgePart59.BrickColor = BrickColor.new("Medium blue")
- CornerWedgePart59.Rotation = Vector3.new(-100.829994, -46.4399986, 97.9300003)
- CornerWedgePart59.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
- CornerWedgePart59.CFrame = CFrame.new(45.7350616, 5.97116518, -12.9361191, -0.0951149613, -0.682498157, -0.72467196, -0.284332901, -0.679019213, 0.676821768, -0.953995645, 0.270423949, -0.129471824)
- CornerWedgePart59.Color = Color3.new(0.431373, 0.6, 0.792157)
- CornerWedgePart59.Position = Vector3.new(45.7350616, 5.97116518, -12.9361191)
- CornerWedgePart59.Orientation = Vector3.new(-42.5999985, -100.129997, -157.279999)
- CornerWedgePart59.Color = Color3.new(0.431373, 0.6, 0.792157)
- Part60.Parent = Tool0
- Part60.Material = Enum.Material.Metal
- Part60.BrickColor = BrickColor.new("Black")
- Part60.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
- Part60.FormFactor = Enum.FormFactor.Custom
- Part60.Size = Vector3.new(2.49999833, 0.0999999493, 0.0999999493)
- Part60.CFrame = CFrame.new(45.7174721, 5.66505098, -14.4666691, 0.0951151401, -0.968833447, -0.228724658, 0.284334123, 0.246635124, -0.926458538, 0.953995466, 0.0230860114, 0.298931152)
- Part60.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part60.Position = Vector3.new(45.7174721, 5.66505098, -14.4666691)
- Part60.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
- Part60.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh61.Parent = Part60
- SpecialMesh61.MeshType = Enum.MeshType.Cylinder
- Part62.Parent = Tool0
- Part62.Material = Enum.Material.Metal
- Part62.BrickColor = BrickColor.new("Black")
- Part62.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
- Part62.FormFactor = Enum.FormFactor.Custom
- Part62.Size = Vector3.new(0.0825000033, 0.0825000033, 0.0825000033)
- Part62.CFrame = CFrame.new(45.8316116, 6.00625515, -13.3218632, 0.0951151401, -0.968833447, -0.228724658, 0.284334123, 0.246635124, -0.926458538, 0.953995466, 0.0230860114, 0.298931152)
- Part62.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part62.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part62.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part62.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part62.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part62.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part62.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part62.Position = Vector3.new(45.8316116, 6.00625515, -13.3218632)
- Part62.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
- Part62.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh63.Parent = Part62
- SpecialMesh63.MeshType = Enum.MeshType.Sphere
- Script64.Name = "qPerfectionWeld"
- Script64.Parent = Tool0
- table.insert(cors,sandbox(Script64,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- 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