SHOW:
|
|
- or go back to the newest paste.
| 1 | local r=NS([===[ | |
| 2 | --[[This is a local script so run as local(obviously)]]-- | |
| 3 | -------------------------------------------------------------------------------------------------- | |
| 4 | -------------------------------------------------------------------------------------------------- | |
| 5 | Me = owner | |
| 6 | Char = Me.Character | |
| 7 | Mode={"BloodLust","Normal"}
| |
| 8 | DTable={}
| |
| 9 | Combo = 0 | |
| 10 | Name="MoonLight Katana" | |
| 11 | PrimaryColor = "Really black" | |
| 12 | SecondaryColor="White" | |
| 13 | pcall(function() Char:FindFirstChild("WepModel"):Destroy() Me.Backpack:FindFirstChild(Name):Destroy() end)
| |
| 14 | Activated = false | |
| 15 | Dashing = false | |
| 16 | Selected = false | |
| 17 | ADB=false | |
| 18 | DiffColor = false | |
| 19 | Camera=game:service("Workspace").CurrentCamera
| |
| 20 | LeftArm = Char["Left Arm"] | |
| 21 | RightArm = Char["Right Arm"] | |
| 22 | HRP = Char.HumanoidRootPart["RootJoint"] | |
| 23 | SavedRoot = HRP.C0 | |
| 24 | necko=CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
| 25 | local WepModel = Instance.new("Model", Char)
| |
| 26 | WepModel.Name = "WepModel" | |
| 27 | local Debz = game:service("Debris")
| |
| 28 | ------[[ Create Function ]]------ | |
| 29 | Create = {}
| |
| 30 | function Create:Part(parent, x,y,z, color, transparency, cancollide, anchored, shape) | |
| 31 | c = Instance.new("Part",parent)
| |
| 32 | c.Material = "SmoothPlastic" | |
| 33 | Sheathed = true | |
| 34 | if shape ~= nil then | |
| 35 | c.Shape = shape | |
| 36 | end | |
| 37 | c.TopSurface,c.BottomSurface = 0,0 | |
| 38 | c.Locked = true | |
| 39 | c.formFactor = "Custom" | |
| 40 | c.Size = Vector3.new(x,y,z) | |
| 41 | if color ~= "random" then | |
| 42 | c.BrickColor = color | |
| 43 | else c.BrickColor = BrickColor:Random() end | |
| 44 | c.Transparency = transparency | |
| 45 | c.CanCollide = cancollide | |
| 46 | if anchored ~= nil then c.Anchored = anchored end | |
| 47 | if parent ~= nil then c.Parent = parent end | |
| 48 | return c | |
| 49 | end; | |
| 50 | function Create:BG(parent) | |
| 51 | local c = Instance.new("BodyGyro",parent)
| |
| 52 | c.P = 20e+003 | |
| 53 | c.cframe = parent.CFrame | |
| 54 | c.maxTorque = Vector3.new(c.P,c.P,c.P) | |
| 55 | return c | |
| 56 | end; | |
| 57 | function Create:BP(parent, pos) | |
| 58 | local bp = Instance.new("BodyPosition",parent)
| |
| 59 | bp.maxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 60 | bp.position = pos | |
| 61 | return bp | |
| 62 | end; | |
| 63 | function Create:F(parent, size, heat, color, secondarycolor, enabled) | |
| 64 | f = Instance.new("Fire",parent)
| |
| 65 | f.Size = size | |
| 66 | f.Heat = heat | |
| 67 | if enabled ~= nil then f.Enabled = enabled end | |
| 68 | if color ~= nil then f.Color = BrickColor.new(color).Color end | |
| 69 | if secondarycolor ~= nil then f.SecondaryColor = BrickColor.new(secondarycolor).Color end | |
| 70 | return f | |
| 71 | end; | |
| 72 | function Create:FM(parent, meshid, x,y,z, meshtexture) | |
| 73 | if meshid == "cylinder" then | |
| 74 | mesh = Instance.new("CylinderMesh",parent)
| |
| 75 | mesh.Scale = Vector3.new(x,y,z) | |
| 76 | return mesh | |
| 77 | else | |
| 78 | mesh = Instance.new("SpecialMesh",parent)
| |
| 79 | if meshid ~= "sphere" then | |
| 80 | if type(meshid) == "number" then mesh.MeshId = "rbxassetid://"..meshid else | |
| 81 | mesh.MeshId = "rbxassetid://"..meshids[meshid] | |
| 82 | end | |
| 83 | else mesh.MeshType = 3 end | |
| 84 | mesh.Scale = Vector3.new(x,y,z) | |
| 85 | if meshtexture ~= nil then | |
| 86 | if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else | |
| 87 | mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end | |
| 88 | end | |
| 89 | return mesh | |
| 90 | end | |
| 91 | end | |
| 92 | function Create:Weld(parent,P0,P1,nam,c0,c1) | |
| 93 | Weld = Instance.new("Weld",parent)
| |
| 94 | if P0 then Weld.Part0 = P0 else error("Invalid Part0",2) end
| |
| 95 | if P1 then Weld.Part1 = P1 else print("Invalid Part1") end
| |
| 96 | if name then Weld.Name = nam else Weld.Name = "Weld" end | |
| 97 | if c0 then Weld.C0 = c0 else print("Invalid C0") end
| |
| 98 | if c1 then Weld.C1 = c1 else Weld.C1 = CFrame.new(0,0.5,0) end | |
| 99 | return Weld | |
| 100 | end | |
| 101 | M = {["Cos"] = function(a) return math.cos(a) end;
| |
| 102 | ["Sin"] = function(a) return math.sin(a) end; | |
| 103 | ["Rad"] = function(a) return math.rad(a) end} | |
| 104 | L0L=Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),1,false,false) | |
| 105 | L0LWeld=Create:Weld(L0L,Char.Torso,L0L,"L0LWeld",CFrame.new(0,0,0)*CFrame.fromEulerAnglesXYZ(0,math.rad(-90),math.rad(90)),CFrame.new(0,-0.951,0)) | |
| 106 | coroutine.wrap(function() | |
| 107 | for i = 0,1,1/50 do wait() | |
| 108 | angle = math.rad(360*i) | |
| 109 | end | |
| 110 | end)() | |
| 111 | local Delete = function(parent,time) | |
| 112 | if time then | |
| 113 | Debz:AddItem(parent,time) | |
| 114 | else | |
| 115 | parent:Destroy() | |
| 116 | end end | |
| 117 | Lite = Instance.new("PointLight")
| |
| 118 | Lite.Color = Color3.new(255,255,255) | |
| 119 | Lite.Range = 10 | |
| 120 | Lite.Brightness = 10 | |
| 121 | Lite.Parent = Char.Torso | |
| 122 | Handle = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false) | |
| 123 | Instance.new("BlockMesh",Handle).Scale = Vector3.new(0.2,1.15,0.275)
| |
| 124 | HandleWeld=Create:Weld(Handle,Char.Torso,Handle,"HandleWeld",CFrame.new(1.5,1.8,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75)) | |
| 125 | Hitbox = Create:Part(WepModel,1,6,0.5,BrickColor.new(PrimaryColor),1,false,false) | |
| 126 | Hitbox.Name = "Hitbox" | |
| 127 | Instance.new("BlockMesh", Hitbox)
| |
| 128 | BoxWeld=Create:Weld(Hitbox,Handle,Hitbox,"Boxweld",CFrame.new(0,-2.5,0),CFrame.new(0,-0.25,0)) | |
| 129 | Sheath = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false) | |
| 130 | Instance.new("BlockMesh",Sheath).Scale = Vector3.new(0.3,3,0.3)
| |
| 131 | SheathWeld=Create:Weld(Char.Torso,Char.Torso,Sheath,"SheathWeld",CFrame.new(0.25,-0.1,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75),CFrame.new(0.2,0.5,0)) | |
| 132 | for i = 1,6 do | |
| 133 | Boxes = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false) | |
| 134 | Instance.new("BlockMesh",Boxes).Scale = Vector3.new(0.225,0.2,0.31)
| |
| 135 | BoxesWeld=Create:Weld(Boxes,Char.Torso,Boxes,"BoxesWeld",CFrame.new(1.95,0,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75),CFrame.new(1.55,i*0.5,0)) | |
| 136 | end | |
| 137 | SheathTip = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false) | |
| 138 | SheathMesh = Instance.new("SpecialMesh", SheathTip)
| |
| 139 | SheathMesh.MeshType = "Wedge" | |
| 140 | SheathMesh.Scale = Vector3.new(0.3,0.75,0.3) | |
| 141 | SheathTipWeld=Create:Weld(Char.Torso,Sheath,SheathTip,"SheathTipWeld",CFrame.new(0.25,-2,0.65)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.65,0.14,0.25)) | |
| 142 | print(SheathTip.Position,SheathTip.Transparency) | |
| 143 | HandleBase = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false) | |
| 144 | Instance.new("BlockMesh",HandleBase).Scale = Vector3.new(0.45,0.25,0.45)
| |
| 145 | HandleBaseWeld=Create:Weld(HandleBase,Handle,HandleBase,"HandleBaseWeld",CFrame.new(0,-0.175,0)) | |
| 146 | Blade = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false) | |
| 147 | Instance.new("BlockMesh",Blade).Scale = Vector3.new(0.2,3,0.155)
| |
| 148 | BladeWeld=Create:Weld(Blade,Handle,Blade,"BladeWeld",CFrame.new(0,-1.75,0)) | |
| 149 | Blade2 = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false) | |
| 150 | Instance.new("BlockMesh",Blade2).Scale = Vector3.new(0.1,3,0.156)
| |
| 151 | Blade2Weld=Create:Weld(Blade2,Handle,Blade2,"Blade2Weld",CFrame.new(0,-1.75,0)) | |
| 152 | Tip = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false) | |
| 153 | TipMesh = Instance.new("SpecialMesh", Tip)
| |
| 154 | TipMesh.MeshType = "Wedge" | |
| 155 | TipMesh.Scale = Vector3.new(0.155,0.5,0.2) | |
| 156 | TipWeld=Create:Weld(Tip,Handle,Tip,"TipWeld",CFrame.new(0,-4.5,0)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.01,0.5,0)) | |
| 157 | Tip2 = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false) | |
| 158 | Tip2Mesh = Instance.new("SpecialMesh", Tip2)
| |
| 159 | Tip2Mesh.MeshType = "Wedge" | |
| 160 | Tip2Mesh.Scale = Vector3.new(0.16,0.3,0.1) | |
| 161 | Tip2Weld=Create:Weld(Tip2,Handle,Tip2,"Tip2Weld",CFrame.new(0,-4.4,0)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.01,0.5,0)) | |
| 162 | function Dash() | |
| 163 | Dashing = true | |
| 164 | DBounce=true | |
| 165 | playSound(153092348,Hitbox,1,1) | |
| 166 | local vel = Instance.new("BodyVelocity", Char.Torso)
| |
| 167 | vel.maxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 168 | coroutine.resume(coroutine.create(function() | |
| 169 | while Dashing == true do wait() | |
| 170 | vel.velocity = Char.Head.CFrame.lookVector * 70 | |
| 171 | Effect(Char.Torso, 1,0.5,1, 0,0,1, 0,0,0,BrickColor.new("Navy blue"),true, 20329976,Char.Torso.CFrame*CFrame.new(0,-2.75,0).p)
| |
| 172 | end | |
| 173 | end)) | |
| 174 | wait(1) | |
| 175 | vel:remove() | |
| 176 | Dashing = false | |
| 177 | wait(1) | |
| 178 | DBounce=false | |
| 179 | end | |
| 180 | --Sound Func | |
| 181 | function playSound(id,parent,volume,pitch) | |
| 182 | local sound = Instance.new("Sound",parent or workspace)
| |
| 183 | sound.SoundId = "http://www.roblox.com/asset?id="..id | |
| 184 | sound.Volume = volume or 1 | |
| 185 | sound.Pitch = pitch or 1 | |
| 186 | coroutine.wrap(function() | |
| 187 | wait() | |
| 188 | sound:Play() | |
| 189 | wait(10) | |
| 190 | sound:Stop() | |
| 191 | sound:Destroy() | |
| 192 | end)() | |
| 193 | return sound | |
| 194 | end | |
| 195 | --Play Sound | |
| 196 | function Shoot() | |
| 197 | Activated = true | |
| 198 | Charging = true | |
| 199 | Idle() | |
| 200 | StartTrail(Tip) | |
| 201 | for i = 0,1,0.1 do wait() | |
| 202 | RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0) | |
| 203 | RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-i*1.575,i*0.15) | |
| 204 | end | |
| 205 | coroutine.wrap(function() | |
| 206 | while Charging == true do wait() | |
| 207 | Effect2(Tip,0.4,0.4,0.4,0,0,0,BrickColor.new(SecondaryColor)) | |
| 208 | end | |
| 209 | end)() | |
| 210 | end | |
| 211 | function FirstSlash() | |
| 212 | playSound(10209645,Hitbox,1,1) | |
| 213 | Activated = true | |
| 214 | Combo = 1 | |
| 215 | StartTrail(Tip) | |
| 216 | pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(8,10), hit.CFrame.p) end) end) | |
| 217 | Walk() | |
| 218 | for i = 0,1,0.175 do wait() | |
| 219 | LW.C1 = CFrame.new(0,0.5,0)*CFrame.fromEulerAnglesXYZ(0,0,i*0.3) | |
| 220 | RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(i*2.15,i*-0.75,i*-1.5) | |
| 221 | HRP.C0 = SavedRoot*CFrame.fromEulerAnglesXYZ(0,0,i*2) | |
| 222 | Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,-1.45*i) | |
| 223 | end | |
| 224 | EndTrail() | |
| 225 | Hitdmg:disconnect(wait(0.1)) | |
| 226 | Activated = false | |
| 227 | end | |
| 228 | function SecondSlash() | |
| 229 | playSound(10209645,Hitbox,1,1.2) | |
| 230 | Activated = true | |
| 231 | Combo = 2 | |
| 232 | StartTrail(Tip) | |
| 233 | pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(2,6), hit.CFrame.p) end) end) | |
| 234 | for i = 0,1,0.2 do wait() | |
| 235 | RW.C0 = CFrame.new(1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0) | |
| 236 | RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-i*1.5,0) | |
| 237 | end | |
| 238 | for i = 0,1,0.2 do wait() | |
| 239 | Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,0.725*i) | |
| 240 | RW.C1 = CFrame.new(0,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-1.5,i*-1.5) | |
| 241 | HRP.C0 = HRP.C1*CFrame.fromEulerAnglesXYZ(0,0,i*-0.875) | |
| 242 | end | |
| 243 | EndTrail() | |
| 244 | Hitdmg:disconnect(wait(0.1)) | |
| 245 | Activated = false | |
| 246 | end | |
| 247 | function ThirdSlash() | |
| 248 | playSound(10209645,Hitbox,1,1.3) | |
| 249 | Activated=true | |
| 250 | Combo=3 | |
| 251 | StartTrail(Tip) | |
| 252 | for i = 0,1,0.2 do wait() | |
| 253 | HRP.C1 = HRP.C1*CFrame.fromEulerAnglesXYZ(0,0,i*-0.25) | |
| 254 | RW.C0 = CFrame.new(1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0) | |
| 255 | RW.C1 = CFrame.new(0,i,-0.15)*CFrame.fromEulerAnglesXYZ(i*-1.05,0,i*0.85) | |
| 256 | LW.C0 = CFrame.new(-1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0) | |
| 257 | LW.C1 = CFrame.new(0,i,-0.15)*CFrame.fromEulerAnglesXYZ(i*-1.05,0,i*-0.85) | |
| 258 | Char.Torso.Neck.C0=necko | |
| 259 | HandleWeld.C0 = CFrame.new(0,-1.075,0.6)*CFrame.fromEulerAnglesXYZ(math.rad(45/2),math.rad(90),math.rad(69)) | |
| 260 | HandleWeld.C1 = CFrame.new(0,0.3,0.25)*CFrame.Angles(math.rad(-40),math.rad(-12),math.rad(-10)) | |
| 261 | end | |
| 262 | pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(20,35), hit.CFrame.p,0) | |
| 263 | if hit:IsA("Part") then
| |
| 264 | local evel = Instance.new("BodyVelocity", hit)
| |
| 265 | evel.maxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 266 | evel.velocity = Char.Torso.CFrame.lookVector * 100 | |
| 267 | Delete(evel,0.025) | |
| 268 | end end) end) | |
| 269 | for i = 0,1,0.2 do wait() | |
| 270 | RW.C1 = RW.C1*CFrame.new(0,-0.05,0)*CFrame.fromEulerAnglesXYZ(i*0.75,0,0) | |
| 271 | LW.C1 = LW.C1*CFrame.new(0,-0.05,0)*CFrame.fromEulerAnglesXYZ(i*0.75,0,0) | |
| 272 | end | |
| 273 | Hitdmg:disconnect(wait(0.1)) | |
| 274 | EndTrail() | |
| 275 | Activated=false | |
| 276 | end | |
| 277 | function BDown() | |
| 278 | if Activated then return end | |
| 279 | if Combo == 0 then | |
| 280 | FirstSlash() | |
| 281 | coroutine.wrap(function() | |
| 282 | wait(0.2) | |
| 283 | if Activated == false then | |
| 284 | Combo = 0 | |
| 285 | end | |
| 286 | end)() | |
| 287 | elseif Combo == 1 then | |
| 288 | SecondSlash() | |
| 289 | coroutine.wrap(function() | |
| 290 | wait(0.2) | |
| 291 | if Activated == false then | |
| 292 | Combo = 0 | |
| 293 | end | |
| 294 | end)() | |
| 295 | elseif Combo == 2 then | |
| 296 | ThirdSlash() | |
| 297 | coroutine.wrap(function() | |
| 298 | wait(0.2) | |
| 299 | if Activated == false then | |
| 300 | Combo = 0 | |
| 301 | end | |
| 302 | end)() | |
| 303 | end | |
| 304 | end | |
| 305 | function key(key) | |
| 306 | if Activated then return end | |
| 307 | if key == "x" and not DBounce then | |
| 308 | Dash() | |
| 309 | end | |
| 310 | end | |
| 311 | function Walk() | |
| 312 | Camera.CameraSubject=Char.Humanoid | |
| 313 | Char.Humanoid.WalkSpeed = 25 | |
| 314 | RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45,0,-0.2) | |
| 315 | RW.C1 = CFrame.new(0,0.35,0)*CFrame.fromEulerAnglesXYZ(3.5,0.5,0.9) | |
| 316 | LW.C0 = CFrame.new(-1.4,0.45,0)*CFrame.fromEulerAnglesXYZ(0.4,0.25,-0.5) | |
| 317 | LW.C1 = CFrame.new(0,0.5,0) | |
| 318 | HRP.C0 = SavedRoot*CFrame.fromEulerAnglesXYZ(0,0,-1.5) | |
| 319 | HRP.C1=CFrame.new(0,0,0,-1,-0,-0,0,0,1,0,1,0) | |
| 320 | Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,1.5) | |
| 321 | HandleWeld.Part0 = RightArm | |
| 322 | HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0) | |
| 323 | HandleWeld.C1 = CFrame.new(0,0.5,0) | |
| 324 | HandleWeld.Part1 = Handle | |
| 325 | end | |
| 326 | ||
| 327 | function Idle() | |
| 328 | if RW and LW then | |
| 329 | RW.Part0 = Char.Torso | |
| 330 | RW.C0 = CFrame.new(1.5, 0.5, -0)*CFrame.fromEulerAnglesXYZ(0,0,0.2) | |
| 331 | RW.C1 = CFrame.new(0, 0.5, 0) | |
| 332 | RW.Part1 = RightArm | |
| 333 | LW.Part0 = Char.Torso | |
| 334 | LW.C0 = CFrame.new(-1.5, 0.5, 0)*CFrame.fromEulerAnglesXYZ(0,0,-0.2) | |
| 335 | LW.C1 = CFrame.new(0, 0.5, 0) | |
| 336 | LW.Part1 = LeftArm | |
| 337 | Char.Torso.Neck.C0=necko | |
| 338 | Camera.CameraSubject=Char.Humanoid | |
| 339 | HRP.C0=SavedRoot | |
| 340 | HRP.C1=CFrame.new(0,0,0,-1,-0,-0,0,0,1,0,1,0) | |
| 341 | Char.Humanoid.WalkSpeed = 16 | |
| 342 | HandleWeld.Part0 = RightArm | |
| 343 | HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0) | |
| 344 | HandleWeld.C1 = CFrame.new(0,0.5,0) | |
| 345 | HandleWeld.Part1 = Handle | |
| 346 | end | |
| 347 | end | |
| 348 | function Selection() | |
| 349 | for i = 0,1,0.1 do wait() | |
| 350 | RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45*i,0,i*-0.2) | |
| 351 | end | |
| 352 | playSound(130785405,Hitbox,1,1) | |
| 353 | ||
| 354 | HandleWeld.Part0 = RightArm | |
| 355 | HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0) | |
| 356 | HandleWeld.C1 = CFrame.new(0,0.5,0) | |
| 357 | HandleWeld.Part1 = Handle | |
| 358 | for i = 0,1,0.15 do wait() | |
| 359 | RW.C1 = CFrame.new(0,0.35,0)*CFrame.fromEulerAnglesXYZ(i*3.5,i*0.75,i) | |
| 360 | LW.C0 = CFrame.new(-1.4,0.45,0)*CFrame.fromEulerAnglesXYZ(i*0.4,i*0.25,i*-0.25) | |
| 361 | end | |
| 362 | Idle() | |
| 363 | Selected = true | |
| 364 | Sheathed = false | |
| 365 | end | |
| 366 | function s() | |
| 367 | if Sheathing then return end | |
| 368 | RSH = Char.Torso["Right Shoulder"] | |
| 369 | LSH = Char.Torso["Left Shoulder"] | |
| 370 | RW=Create:Weld(RightArm,Char.Torso,RightArm,"RW",CFrame.new(1.5, 0.5, -0)*CFrame.fromEulerAnglesXYZ(1.5,1.15,-0.25)) | |
| 371 | LW=Create:Weld(LeftArm,Char.Torso,LeftArm,"LW",CFrame.new(-1.5, 0.5, 0)*CFrame.fromEulerAnglesXYZ(-0.5,0,-0.1)) | |
| 372 | Selection() | |
| 373 | Idle() | |
| 374 | Sheathed = false | |
| 375 | end | |
| 376 | function ds() | |
| 377 | Sheathing = true | |
| 378 | RW.C0 = CFrame.new(1.5, 0.5, -0) | |
| 379 | RW.C1 = CFrame.new(0, 0.5, 0) | |
| 380 | for i =0,1,0.1 do wait() | |
| 381 | RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45*i,0,i*-0.2) | |
| 382 | end | |
| 383 | playSound(130785407,Hitbox,1,1) | |
| 384 | HandleWeld.Part0 = Char.Torso | |
| 385 | HandleWeld.C0 = CFrame.new(1.5,1.8,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75) | |
| 386 | HandleWeld.C1 = CFrame.new(0,0.5,0) | |
| 387 | HandleWeld.Part1 = Handle | |
| 388 | pcall(function() HRP.C0 = SavedRoot | |
| 389 | RW.Parent = nil | |
| 390 | LW.Parent = nil | |
| 391 | Char.Torso.Neck.C0 = necko | |
| 392 | RSH.Parent = Char.Torso | |
| 393 | LSH.Parent = Char.Torso end) | |
| 394 | Sheathing = false | |
| 395 | Sheathed = true | |
| 396 | Char.Humanoid.WalkSpeed = 16 | |
| 397 | end | |
| 398 | function StartTrail(part,color) | |
| 399 | trailin = true | |
| 400 | local lastPoint = part.Position | |
| 401 | coroutine.wrap(function() | |
| 402 | while trailin do wait() | |
| 403 | local point = CFrame.new(lastPoint, part.Position) * CFrame.Angles(-math.pi/2, 0, 0) | |
| 404 | local mag = (lastPoint - part.Position).magnitude | |
| 405 | local p = Create:Part(Char,1,1,1,BrickColor.new(PrimaryColor),0.1,false,true) | |
| 406 | if color then p.BrickColor = BrickColor.new(color) end | |
| 407 | Instance.new("SpecialMesh",p).Scale=Vector3.new(0.125, mag, 0.125)
| |
| 408 | p.CFrame = point * CFrame.new(0, mag/1.95, 0) | |
| 409 | lastPoint = part.Position | |
| 410 | coroutine.wrap(function() for i = 0,1,0.1 do wait() p.Transparency = i end p:Destroy() end)() | |
| 411 | end | |
| 412 | end)() | |
| 413 | end | |
| 414 | function EndTrail() | |
| 415 | trailin = false | |
| 416 | end | |
| 417 | Damage = function(hit, dmg, pos,time) | |
| 418 | if ADB == false then | |
| 419 | ADB = true | |
| 420 | coroutine.wrap(function() | |
| 421 | if time ==nil then | |
| 422 | ADB=false | |
| 423 | else | |
| 424 | wait(time) | |
| 425 | end | |
| 426 | ADB = false | |
| 427 | end)() | |
| 428 | if hit.Parent==nil and hit.Parent.Torso == nil then | |
| 429 | return | |
| 430 | print("hai")
| |
| 431 | end | |
| 432 | if hit~=nil and hit.Parent ~= Char then | |
| 433 | hum = hit.Parent:FindFirstChild("Humanoid")
| |
| 434 | if hum and hum.Health ~= 0 then | |
| 435 | playSound(153092292,Hitbox,1,1) | |
| 436 | critcalchance = math.ceil(math.random(1,15)) | |
| 437 | if critcalchance == 5 then | |
| 438 | pcall(function() hum.Health = hum.Health - dmg*2 end) | |
| 439 | if hum.Health == 0 then | |
| 440 | KO=true | |
| 441 | else | |
| 442 | KO=false | |
| 443 | end | |
| 444 | crit = true | |
| 445 | else | |
| 446 | pcall(function() hum.Health = hum.Health - dmg end) | |
| 447 | if hum.Health == 0 then | |
| 448 | KO=true | |
| 449 | else | |
| 450 | KO=false | |
| 451 | end | |
| 452 | crit = false | |
| 453 | end | |
| 454 | mod = Instance.new("Model",game:service("Workspace"))
| |
| 455 | if not KO then | |
| 456 | if crit == true then | |
| 457 | mod.Name = "-"..(dmg*2) | |
| 458 | else | |
| 459 | mod.Name = "-"..dmg | |
| 460 | end | |
| 461 | else | |
| 462 | mod.Name = "KO!" | |
| 463 | crit=true | |
| 464 | end | |
| 465 | if not crit then | |
| 466 | p = Create:Part(mod,0.25,0.15,0.25, BrickColor.new(SecondaryColor),0.25,false,false) | |
| 467 | else | |
| 468 | p = Create:Part(mod,0.35,0.25,0.35, BrickColor.new("Really red"),0.25,false,false)
| |
| 469 | end | |
| 470 | p.CFrame = CFrame.new(pos)*CFrame.new(0,1,math.random(-2,2)) | |
| 471 | BP = Create:BP(p,p.Position+Vector3.new(0,6,0)) | |
| 472 | BP.P = 1500 | |
| 473 | s = Instance.new("SelectionBox",p)
| |
| 474 | s.Adornee = s.Parent | |
| 475 | s.Transparency=p.Transparency | |
| 476 | s.Color = p.BrickColor | |
| 477 | local BGUI = Instance.new("BillboardGui",p)
| |
| 478 | BGUI.Size = UDim2.new(1,0,1,0) | |
| 479 | BGUI.StudsOffset = Vector3.new(0,1,0) | |
| 480 | BGUI.Adornee = BGUI.Parent | |
| 481 | local frame = Instance.new("Frame",BGUI)
| |
| 482 | frame.Size = UDim2.new(1, 0, 1, 0) | |
| 483 | frame.BackgroundTransparency = 1 | |
| 484 | frame.BackgroundColor3 = Color3.new(1, 1, 1) | |
| 485 | local BText = Instance.new("TextLabel",BGUI)
| |
| 486 | BText.TextStrokeTransparency = 0 | |
| 487 | BText.TextStrokeColor3 = BrickColor.new(PrimaryColor).Color | |
| 488 | BText.BackgroundTransparency = 1 | |
| 489 | BText.Position = UDim2.new(0, 0, 0.1, 0) | |
| 490 | BText.FontSize = "Size18" | |
| 491 | BText.Size = UDim2.new(0.9, 0, 0.4, 0) | |
| 492 | if not crit and not KO then | |
| 493 | BText.Font = "SourceSans" | |
| 494 | BText.TextColor3 = BrickColor.new(SecondaryColor).Color | |
| 495 | elseif crit and not KO then | |
| 496 | BText.FontSize = "Size24" | |
| 497 | BText.Font = "SourceSans" | |
| 498 | BText.TextColor3 = BrickColor.new("Really red").Color
| |
| 499 | elseif KO and crit then | |
| 500 | BText.FontSize = "Size36" | |
| 501 | BText.Font = "Legacy" | |
| 502 | BText.TextColor3 = BrickColor.new("Really red").Color
| |
| 503 | end | |
| 504 | BText.Font = "SourceSans" | |
| 505 | BText.Text = mod.Name | |
| 506 | Delete(mod,2.5) | |
| 507 | coroutine.wrap(function() | |
| 508 | wait(0.5) | |
| 509 | for i = 0,1,0.035 do wait() | |
| 510 | BText.TextTransparency = i | |
| 511 | BText.TextStrokeTransparency = BText.TextStrokeTransparency + i | |
| 512 | end | |
| 513 | end)() | |
| 514 | end | |
| 515 | end | |
| 516 | end | |
| 517 | end | |
| 518 | function Effect(part,x1,y1,z1,x2,y2,z2,x3,y3,z3,color,meshid,id,pos,collid) | |
| 519 | S=Create:Part(Char, 1,1,1, color, 0, false, true) | |
| 520 | if collid then | |
| 521 | S.CanCollide=collid | |
| 522 | else | |
| 523 | S.CanCollide=false | |
| 524 | end | |
| 525 | S.CFrame = CFrame.new(pos) | |
| 526 | S.CFrame=S.CFrame*CFrame.new(x2,y2,z2)*CFrame.fromEulerAnglesXYZ(x3,y3,z3) | |
| 527 | if meshid == true then | |
| 528 | local msh1 = Instance.new("SpecialMesh",S)
| |
| 529 | msh1.Scale = Vector3.new(1,1,1) | |
| 530 | msh1.MeshType = "FileMesh" | |
| 531 | msh1.MeshId = "http://www.roblox.com/asset/?id="..id.."" | |
| 532 | end | |
| 533 | if meshid == "block" then | |
| 534 | msh1 = Instance.new("BlockMesh",S)
| |
| 535 | msh1.Scale = Vector3.new(1,1,1) | |
| 536 | elseif meshid == "ball" then | |
| 537 | local msh1 = Instance.new("SpecialMesh",S)
| |
| 538 | msh1.Scale = Vector3.new(1,1,1) | |
| 539 | msh1.MeshType = "Sphere" | |
| 540 | end | |
| 541 | coroutine.resume(coroutine.create(function(Part,CF) for i=1, 9 do Part.Mesh.Scale = Part.Mesh.Scale + Vector3.new(x1, y1, z1) Part.Transparency=i*.1 wait() end Part:Destroy() end),S,S.CFrame) | |
| 542 | end | |
| 543 | Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency) | |
| 544 | local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset}
| |
| 545 | for i=1,Times do | |
| 546 | local li = Instance.new("Part",workspace)
| |
| 547 | li.Material = "SmoothPlastic" | |
| 548 | li.TopSurface = "SmoothNoOutlines" | |
| 549 | li.BottomSurface = "SmoothNoOutlines" | |
| 550 | li.RightSurface = "SmoothNoOutlines" | |
| 551 | li.LeftSurface = "SmoothNoOutlines" | |
| 552 | li.Anchored = true li.Transparency = | |
| 553 | Transparency or 0.4 li.BrickColor = | |
| 554 | BrickColor.new(Color) | |
| 555 | li.formFactor = "Custom" | |
| 556 | li.CanCollide = false | |
| 557 | li.Size = Vector3.new(1,1,1) | |
| 558 | lim = Instance.new("BlockMesh",li)
| |
| 559 | lim.Scale = Vector3.new(Thickness,Thickness,magz/Times) | |
| 560 | local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) | |
| 561 | function touch(hit) | |
| 562 | if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent ~= Char then
| |
| 563 | Damage(hit, math.random(1,2), hit.CFrame.p) | |
| 564 | end end li.Touched:connect(touch) | |
| 565 | local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz | |
| 566 | if Times == i then | |
| 567 | local magz2 = (curpos - End).magnitude lim.Scale = Vector3.new(Thickness,Thickness,magz2) | |
| 568 | li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2) | |
| 569 | else | |
| 570 | li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2) | |
| 571 | end | |
| 572 | curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p game.Debris:AddItem(li,0.25) | |
| 573 | end | |
| 574 | end | |
| 575 | function Effect2(part,x1,y1,z1,x2,y2,z2,color) | |
| 576 | local msh2 = Instance.new("BlockMesh")
| |
| 577 | msh2.Scale = Vector3.new(x1, y1, z1) | |
| 578 | S=Create:Part(Char, 1,1,1, color, 0.5, false, true) | |
| 579 | msh2.Parent = S | |
| 580 | S.CFrame=part.CFrame*CFrame.new(x2, y2, z2)*CFrame.fromEulerAnglesXYZ(math.random(-50,50),math.random(-50,50),math.random(-50,50)) | |
| 581 | coroutine.resume(coroutine.create(function(Part,CF) for i=1, 9 do Part.Mesh.Scale = Part.Mesh.Scale + Vector3.new(0.1,0.1,0.1) Part.CFrame=Part.CFrame*CFrame.fromEulerAnglesXYZ(math.random(-50,50),math.random(-50,50),math.random(-50,50)) Part.Transparency=i*.1 wait() end Part.Parent=nil end),S,S.CFrame) | |
| 582 | end | |
| 583 | coroutine.wrap(function() | |
| 584 | game:service("RunService").Heartbeat:connect(function()
| |
| 585 | if not Sheathed and not Activated and not Sheathing and Combo == 0 then | |
| 586 | if Vector3.new(Char.Torso.Velocity.x, 0, Char.Torso.Velocity.z).magnitude > 2 then | |
| 587 | Walk() | |
| 588 | else | |
| 589 | Idle() | |
| 590 | end | |
| 591 | end | |
| 592 | end) | |
| 593 | end)() | |
| 594 | pcall(function() script.source.Value = "l0l" end) | |
| 595 | remote=Instance.new('RemoteFunction',script);
| |
| 596 | remote.OnServerInvoke=function(p,r,...) | |
| 597 | if(p~=owner)then return error('You cannot invoke this remote',0); end;
| |
| 598 | ||
| 599 | if (r == 1) then | |
| 600 | key(...); | |
| 601 | elseif (r == 2) then | |
| 602 | BDown(...); | |
| 603 | elseif (r == 3) then | |
| 604 | s(); | |
| 605 | elseif (r == 4) then | |
| 606 | ds(); | |
| 607 | end; | |
| 608 | end; | |
| 609 | remote.Name='S'; | |
| 610 | while true do game:GetService("RunService").Heartbeat:wait(-9001)
| |
| 611 | if not Sheathed then | |
| 612 | wait(math.random(-1,2)) | |
| 613 | lightswitch = math.random(1,2) | |
| 614 | if lightswitch == 1 then | |
| 615 | Lightning(HandleBase.CFrame*CFrame.new(0,1,0).p,Tip.CFrame.p,math.random(3,6),math.random(-0.75,0.75),"White",0.04,0.2) | |
| 616 | elseif lightswitch == 2 then | |
| 617 | Lightning(HandleBase.CFrame*CFrame.new(0,1,0).p,Tip.CFrame.p,math.random(3,6),math.random(-0.75,0.75),PrimaryColor,0.04,0.2) | |
| 618 | end | |
| 619 | end | |
| 620 | end | |
| 621 | ||
| 622 | ]===], owner.Character):WaitForChild 'S'; | |
| 623 | ||
| 624 | b=Instance.new'HopperBin'; | |
| 625 | b.Name = 'Katana'; | |
| 626 | b.Parent = owner.Backpack; | |
| 627 | ||
| 628 | b.Selected:Connect(function(m) | |
| 629 | ||
| 630 | r:InvokeServer(3); | |
| 631 | ||
| 632 | m.KeyDown:Connect(function(k) | |
| 633 | if (k ~= 'x') then return end; | |
| 634 | r:InvokeServer(1,k); | |
| 635 | end); | |
| 636 | m.Button1Down:Connect(function() | |
| 637 | r:InvokeServer(2,m.Hit); | |
| 638 | end); | |
| 639 | ||
| 640 | end); | |
| 641 | ||
| 642 | b.Deselected:Connect (function() | |
| 643 | r:InvokeServer (4); | |
| 644 | end); |