SHOW:
|
|
- or go back to the newest paste.
| 1 | -- This script has been converted to FE by iPxter | |
| 2 | ||
| 3 | ||
| 4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
| 6 | do | |
| 7 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
| |
| 8 | script.Parent = Player.Character | |
| 9 | ||
| 10 | --RemoteEvent for communicating | |
| 11 | local Event = Instance.new("RemoteEvent")
| |
| 12 | Event.Name = "UserInput_Event" | |
| 13 | ||
| 14 | --Fake event to make stuff like Mouse.KeyDown work | |
| 15 | local function fakeEvent() | |
| 16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
| |
| 17 | t.connect = t.Connect | |
| 18 | return t | |
| 19 | end | |
| 20 | ||
| 21 | --Creating fake input objects with fake variables | |
| 22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 26 | end} | |
| 27 | --Merged 2 functions into one by checking amount of arguments | |
| 28 | CAS.UnbindAction = CAS.BindAction | |
| 29 | ||
| 30 | --This function will trigger the events that have been :Connect()'ed | |
| 31 | local function te(self,ev,...) | |
| 32 | local t = m[ev] | |
| 33 | if t and t._fakeEvent and t.Function then | |
| 34 | t.Function(...) | |
| 35 | end | |
| 36 | end | |
| 37 | m.TrigEvent = te | |
| 38 | UIS.TrigEvent = te | |
| 39 | ||
| 40 | Event.OnServerEvent:Connect(function(plr,io) | |
| 41 | if plr~=Player then return end | |
| 42 | if io.isMouse then | |
| 43 | m.Target = io.Target | |
| 44 | m.Hit = io.Hit | |
| 45 | else | |
| 46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 49 | end | |
| 50 | for _,t in pairs(CAS.Actions) do | |
| 51 | for _,k in pairs(t.Keys) do | |
| 52 | if k==io.KeyCode then | |
| 53 | t.Function(t.Name,io.UserInputState,io) | |
| 54 | end | |
| 55 | end | |
| 56 | end | |
| 57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 59 | end | |
| 60 | end) | |
| 61 | Event.Parent = NLS([==[ | |
| 62 | local Player = game:GetService("Players").Rohan_Kishiba
| |
| 63 | local Event = script:WaitForChild("UserInput_Event")
| |
| 64 | ||
| 65 | local UIS = game:GetService("UserInputService")
| |
| 66 | local input = function(io,a) | |
| 67 | if a then return end | |
| 68 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
| |
| 70 | end | |
| 71 | UIS.InputBegan:Connect(input) | |
| 72 | UIS.InputEnded:Connect(input) | |
| 73 | ||
| 74 | local Mouse = Player:GetMouse() | |
| 75 | local h,t | |
| 76 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 77 | --If player is not moving their mouse, client won't fire events | |
| 78 | while wait(1/30) do | |
| 79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 80 | h,t=Mouse.Hit,Mouse.Target | |
| 81 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 82 | end | |
| 83 | end]==],Player.Character) | |
| 84 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
| 85 | end | |
| 86 | ||
| 87 | --//====================================================\\-- | |
| 88 | --|| CREATED BY SHACKLUSTER | |
| 89 | --\\====================================================//-- | |
| 90 | ||
| 91 | wait(0.2) | |
| 92 | ||
| 93 | Player = game:GetService("Players").Rohan_Kishiba
| |
| 94 | PlayerGui = Player.PlayerGui | |
| 95 | Cam = workspace.CurrentCamera | |
| 96 | Backpack = Player.Backpack | |
| 97 | Character = Player.Character | |
| 98 | Humanoid = Character.Humanoid | |
| 99 | RootPart = Character["HumanoidRootPart"] | |
| 100 | Torso = Character["Torso"] | |
| 101 | Head = Character["Head"] | |
| 102 | RightArm = Character["Right Arm"] | |
| 103 | LeftArm = Character["Left Arm"] | |
| 104 | RightLeg = Character["Right Leg"] | |
| 105 | LeftLeg = Character["Left Leg"] | |
| 106 | RootJoint = RootPart["RootJoint"] | |
| 107 | Neck = Torso["Neck"] | |
| 108 | RightShoulder = Torso["Right Shoulder"] | |
| 109 | LeftShoulder = Torso["Left Shoulder"] | |
| 110 | RightHip = Torso["Right Hip"] | |
| 111 | LeftHip = Torso["Left Hip"] | |
| 112 | ||
| 113 | IT = Instance.new | |
| 114 | CF = CFrame.new | |
| 115 | VT = Vector3.new | |
| 116 | RAD = math.rad | |
| 117 | C3 = Color3.new | |
| 118 | UD2 = UDim2.new | |
| 119 | BRICKC = BrickColor.new | |
| 120 | ANGLES = CFrame.Angles | |
| 121 | EULER = CFrame.fromEulerAnglesXYZ | |
| 122 | COS = math.cos | |
| 123 | ACOS = math.acos | |
| 124 | SIN = math.sin | |
| 125 | ASIN = math.asin | |
| 126 | ABS = math.abs | |
| 127 | MRANDOM = math.random | |
| 128 | FLOOR = math.floor | |
| 129 | ||
| 130 | --//=================================\\ | |
| 131 | --|| USEFUL VALUES | |
| 132 | --\\=================================// | |
| 133 | ||
| 134 | Animation_Speed = 3 | |
| 135 | Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60) | |
| 136 | local Speed = 12 | |
| 137 | local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
| 138 | local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
| 139 | local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) | |
| 140 | local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) | |
| 141 | local DAMAGEMULTIPLIER = 1 | |
| 142 | local ANIM = "Idle" | |
| 143 | local ATTACK = false | |
| 144 | local EQUIPPED = false | |
| 145 | local HOLD = false | |
| 146 | local COMBO = 1 | |
| 147 | local Rooted = false | |
| 148 | local SINE = 0 | |
| 149 | local KEYHOLD = false | |
| 150 | local CHANGE = 2 / Animation_Speed | |
| 151 | local WALKINGANIM = false | |
| 152 | local VALUE1 = false | |
| 153 | local VALUE2 = false | |
| 154 | local ROBLOXIDLEANIMATION = IT("Animation")
| |
| 155 | ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation" | |
| 156 | ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571" | |
| 157 | --ROBLOXIDLEANIMATION.Parent = Humanoid | |
| 158 | local WEAPONGUI = IT("ScreenGui", PlayerGui)
| |
| 159 | WEAPONGUI.Name = "Weapon GUI" | |
| 160 | local Weapon = IT("Model")
| |
| 161 | Weapon.Name = "Adds" | |
| 162 | local Effects = IT("Folder", Weapon)
| |
| 163 | Effects.Name = "Effects" | |
| 164 | local ANIMATOR = Humanoid.Animator | |
| 165 | local ANIMATE = Character.Animate | |
| 166 | local UNANCHOR = true | |
| 167 | local PLAYANIMS = true | |
| 168 | local CLOAKED = false | |
| 169 | ||
| 170 | --//=================================\\ | |
| 171 | --\\=================================// | |
| 172 | ||
| 173 | ||
| 174 | --//=================================\\ | |
| 175 | --|| SAZERENOS' ARTIFICIAL HEARTBEAT | |
| 176 | --\\=================================// | |
| 177 | ||
| 178 | ArtificialHB = Instance.new("BindableEvent", script)
| |
| 179 | ArtificialHB.Name = "ArtificialHB" | |
| 180 | ||
| 181 | script:WaitForChild("ArtificialHB")
| |
| 182 | ||
| 183 | frame = Frame_Speed | |
| 184 | tf = 0 | |
| 185 | allowframeloss = false | |
| 186 | tossremainder = false | |
| 187 | lastframe = tick() | |
| 188 | script.ArtificialHB:Fire() | |
| 189 | ||
| 190 | game:GetService("RunService").Heartbeat:connect(function(s, p)
| |
| 191 | tf = tf + s | |
| 192 | if tf >= frame then | |
| 193 | if allowframeloss then | |
| 194 | script.ArtificialHB:Fire() | |
| 195 | lastframe = tick() | |
| 196 | else | |
| 197 | for i = 1, math.floor(tf / frame) do | |
| 198 | script.ArtificialHB:Fire() | |
| 199 | end | |
| 200 | lastframe = tick() | |
| 201 | end | |
| 202 | if tossremainder then | |
| 203 | tf = 0 | |
| 204 | else | |
| 205 | tf = tf - frame * math.floor(tf / frame) | |
| 206 | end | |
| 207 | end | |
| 208 | end) | |
| 209 | ||
| 210 | --//=================================\\ | |
| 211 | --\\=================================// | |
| 212 | ||
| 213 | --//=================================\\ | |
| 214 | --|| SOME FUNCTIONS | |
| 215 | --\\=================================// | |
| 216 | ||
| 217 | function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS) | |
| 218 | return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS) | |
| 219 | end | |
| 220 | ||
| 221 | function PositiveAngle(NUMBER) | |
| 222 | if NUMBER >= 0 then | |
| 223 | NUMBER = 0 | |
| 224 | end | |
| 225 | return NUMBER | |
| 226 | end | |
| 227 | ||
| 228 | function NegativeAngle(NUMBER) | |
| 229 | if NUMBER <= 0 then | |
| 230 | NUMBER = 0 | |
| 231 | end | |
| 232 | return NUMBER | |
| 233 | end | |
| 234 | ||
| 235 | function Swait(NUMBER) | |
| 236 | if NUMBER == 0 or NUMBER == nil then | |
| 237 | ArtificialHB.Event:wait() | |
| 238 | else | |
| 239 | for i = 1, NUMBER do | |
| 240 | ArtificialHB.Event:wait() | |
| 241 | end | |
| 242 | end | |
| 243 | end | |
| 244 | ||
| 245 | function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET) | |
| 246 | local NEWMESH = IT(MESH) | |
| 247 | if MESH == "SpecialMesh" then | |
| 248 | NEWMESH.MeshType = MESHTYPE | |
| 249 | if MESHID ~= "nil" and MESHID ~= "" then | |
| 250 | NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID | |
| 251 | end | |
| 252 | if TEXTUREID ~= "nil" and TEXTUREID ~= "" then | |
| 253 | NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID | |
| 254 | end | |
| 255 | end | |
| 256 | NEWMESH.Offset = OFFSET or VT(0, 0, 0) | |
| 257 | NEWMESH.Scale = SCALE | |
| 258 | NEWMESH.Parent = PARENT | |
| 259 | return NEWMESH | |
| 260 | end | |
| 261 | ||
| 262 | function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR) | |
| 263 | local NEWPART = IT("Part")
| |
| 264 | NEWPART.formFactor = FORMFACTOR | |
| 265 | NEWPART.Reflectance = REFLECTANCE | |
| 266 | NEWPART.Transparency = TRANSPARENCY | |
| 267 | NEWPART.CanCollide = false | |
| 268 | NEWPART.Locked = true | |
| 269 | NEWPART.Anchored = true | |
| 270 | if ANCHOR == false then | |
| 271 | NEWPART.Anchored = false | |
| 272 | end | |
| 273 | NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR)) | |
| 274 | NEWPART.Name = NAME | |
| 275 | NEWPART.Size = SIZE | |
| 276 | NEWPART.Position = Torso.Position | |
| 277 | NEWPART.Material = MATERIAL | |
| 278 | NEWPART:BreakJoints() | |
| 279 | NEWPART.Parent = PARENT | |
| 280 | return NEWPART | |
| 281 | end | |
| 282 | ||
| 283 | local function weldBetween(a, b) | |
| 284 | local weldd = Instance.new("ManualWeld")
| |
| 285 | weldd.Part0 = a | |
| 286 | weldd.Part1 = b | |
| 287 | weldd.C0 = CFrame.new() | |
| 288 | weldd.C1 = b.CFrame:inverse() * a.CFrame | |
| 289 | weldd.Parent = a | |
| 290 | return weldd | |
| 291 | end | |
| 292 | ||
| 293 | ||
| 294 | function QuaternionFromCFrame(cf) | |
| 295 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
| 296 | local trace = m00 + m11 + m22 | |
| 297 | if trace > 0 then | |
| 298 | local s = math.sqrt(1 + trace) | |
| 299 | local recip = 0.5 / s | |
| 300 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
| 301 | else | |
| 302 | local i = 0 | |
| 303 | if m11 > m00 then | |
| 304 | i = 1 | |
| 305 | end | |
| 306 | if m22 > (i == 0 and m00 or m11) then | |
| 307 | i = 2 | |
| 308 | end | |
| 309 | if i == 0 then | |
| 310 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
| 311 | local recip = 0.5 / s | |
| 312 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
| 313 | elseif i == 1 then | |
| 314 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
| 315 | local recip = 0.5 / s | |
| 316 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
| 317 | elseif i == 2 then | |
| 318 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
| 319 | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
| 320 | end | |
| 321 | end | |
| 322 | end | |
| 323 | ||
| 324 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
| 325 | local xs, ys, zs = x + x, y + y, z + z | |
| 326 | local wx, wy, wz = w * xs, w * ys, w * zs | |
| 327 | local xx = x * xs | |
| 328 | local xy = x * ys | |
| 329 | local xz = x * zs | |
| 330 | local yy = y * ys | |
| 331 | local yz = y * zs | |
| 332 | local zz = z * zs | |
| 333 | return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy)) | |
| 334 | end | |
| 335 | ||
| 336 | function QuaternionSlerp(a, b, t) | |
| 337 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
| 338 | local startInterp, finishInterp; | |
| 339 | if cosTheta >= 0.0001 then | |
| 340 | if (1 - cosTheta) > 0.0001 then | |
| 341 | local theta = ACOS(cosTheta) | |
| 342 | local invSinTheta = 1 / SIN(theta) | |
| 343 | startInterp = SIN((1 - t) * theta) * invSinTheta | |
| 344 | finishInterp = SIN(t * theta) * invSinTheta | |
| 345 | else | |
| 346 | startInterp = 1 - t | |
| 347 | finishInterp = t | |
| 348 | end | |
| 349 | else | |
| 350 | if (1 + cosTheta) > 0.0001 then | |
| 351 | local theta = ACOS(-cosTheta) | |
| 352 | local invSinTheta = 1 / SIN(theta) | |
| 353 | startInterp = SIN((t - 1) * theta) * invSinTheta | |
| 354 | finishInterp = SIN(t * theta) * invSinTheta | |
| 355 | else | |
| 356 | startInterp = t - 1 | |
| 357 | finishInterp = t | |
| 358 | end | |
| 359 | end | |
| 360 | return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp | |
| 361 | end | |
| 362 | ||
| 363 | function Clerp(a, b, t) | |
| 364 | local qa = {QuaternionFromCFrame(a)}
| |
| 365 | local qb = {QuaternionFromCFrame(b)}
| |
| 366 | local ax, ay, az = a.x, a.y, a.z | |
| 367 | local bx, by, bz = b.x, b.y, b.z | |
| 368 | local _t = 1 - t | |
| 369 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
| 370 | end | |
| 371 | ||
| 372 | function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME) | |
| 373 | local frame = IT("Frame")
| |
| 374 | frame.BackgroundTransparency = TRANSPARENCY | |
| 375 | frame.BorderSizePixel = BORDERSIZEPIXEL | |
| 376 | frame.Position = POSITION | |
| 377 | frame.Size = SIZE | |
| 378 | frame.BackgroundColor3 = COLOR | |
| 379 | frame.BorderColor3 = BORDERCOLOR | |
| 380 | frame.Name = NAME | |
| 381 | frame.Parent = PARENT | |
| 382 | return frame | |
| 383 | end | |
| 384 | ||
| 385 | function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME) | |
| 386 | local label = IT("TextLabel")
| |
| 387 | label.BackgroundTransparency = 1 | |
| 388 | label.Size = UD2(1, 0, 1, 0) | |
| 389 | label.Position = UD2(0, 0, 0, 0) | |
| 390 | label.TextColor3 = TEXTCOLOR | |
| 391 | label.TextStrokeTransparency = STROKETRANSPARENCY | |
| 392 | label.TextTransparency = TRANSPARENCY | |
| 393 | label.FontSize = TEXTFONTSIZE | |
| 394 | label.Font = TEXTFONT | |
| 395 | label.BorderSizePixel = BORDERSIZEPIXEL | |
| 396 | label.TextScaled = false | |
| 397 | label.Text = TEXT | |
| 398 | label.Name = NAME | |
| 399 | label.Parent = PARENT | |
| 400 | return label | |
| 401 | end | |
| 402 | ||
| 403 | function NoOutlines(PART) | |
| 404 | PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10 | |
| 405 | end | |
| 406 | ||
| 407 | function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1) | |
| 408 | local NEWWELD = IT(TYPE) | |
| 409 | NEWWELD.Part0 = PART0 | |
| 410 | NEWWELD.Part1 = PART1 | |
| 411 | NEWWELD.C0 = C0 | |
| 412 | NEWWELD.C1 = C1 | |
| 413 | NEWWELD.Parent = PARENT | |
| 414 | return NEWWELD | |
| 415 | end | |
| 416 | ||
| 417 | local S = IT("Sound")
| |
| 418 | function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP) | |
| 419 | local NEWSOUND = nil | |
| 420 | coroutine.resume(coroutine.create(function() | |
| 421 | NEWSOUND = S:Clone() | |
| 422 | NEWSOUND.Parent = PARENT | |
| 423 | NEWSOUND.Volume = VOLUME | |
| 424 | NEWSOUND.Pitch = PITCH | |
| 425 | NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID | |
| 426 | NEWSOUND:play() | |
| 427 | if DOESLOOP == true then | |
| 428 | NEWSOUND.Looped = true | |
| 429 | else | |
| 430 | repeat wait(1) until NEWSOUND.Playing == false | |
| 431 | NEWSOUND:remove() | |
| 432 | end | |
| 433 | end)) | |
| 434 | return NEWSOUND | |
| 435 | end | |
| 436 | ||
| 437 | function MakeForm(PART,TYPE) | |
| 438 | if TYPE == "Cyl" then | |
| 439 | local MSH = IT("CylinderMesh",PART)
| |
| 440 | elseif TYPE == "Ball" then | |
| 441 | local MSH = IT("SpecialMesh",PART)
| |
| 442 | MSH.MeshType = "Sphere" | |
| 443 | elseif TYPE == "Wedge" then | |
| 444 | local MSH = IT("SpecialMesh",PART)
| |
| 445 | MSH.MeshType = "Wedge" | |
| 446 | end | |
| 447 | end | |
| 448 | ||
| 449 | function CFrameFromTopBack(at, top, back) | |
| 450 | local right = top:Cross(back) | |
| 451 | return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z) | |
| 452 | end | |
| 453 | ||
| 454 | function PuddleOfBlood(Position,MaxDrop,Model,MaxSize) | |
| 455 | local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model) | |
| 456 | if HITFLOOR ~= nil then | |
| 457 | if HITFLOOR.Parent ~= Weapon and HITFLOOR.Parent ~= Character then | |
| 458 | if HITFLOOR.Name == "BloodPuddle" then | |
| 459 | local DIST = (Position - HITFLOOR.Position).Magnitude | |
| 460 | if (HITFLOOR.Size.Z <= 5 and HITFLOOR.Size.Z < MaxSize) or (HITFLOOR.Size.Z > 5 and HITFLOOR.Size.Z < MaxSize and DIST < HITFLOOR.Size.Z/3) then | |
| 461 | HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1) | |
| 462 | end | |
| 463 | else | |
| 464 | if HITFLOOR.Anchored == true then | |
| 465 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "White", "BloodPuddle", VT(2,0,2)) | |
| 466 | BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0)) | |
| 467 | MakeForm(BLOOD,"Cyl") | |
| 468 | coroutine.resume(coroutine.create(function() | |
| 469 | Swait(75) | |
| 470 | while true do | |
| 471 | Swait() | |
| 472 | BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02) | |
| 473 | if BLOOD.Size.Z < 0.051 then | |
| 474 | BLOOD:remove() | |
| 475 | break | |
| 476 | end | |
| 477 | end | |
| 478 | end)) | |
| 479 | end | |
| 480 | end | |
| 481 | end | |
| 482 | end | |
| 483 | end | |
| 484 | ||
| 485 | function SprayBlood(POSITION,DIRECTION,BloodSize) | |
| 486 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "White", "BloodPuddle", VT(0.3,0.3,0.3),false) | |
| 487 | BLOOD.CFrame = CF(POSITION) | |
| 488 | MakeForm(BLOOD,"Ball") | |
| 489 | local bv = Instance.new("BodyVelocity",BLOOD)
| |
| 490 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
| 491 | bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3)/30,MRANDOM(-3,3)/30,MRANDOM(-3,3)/30)).lookVector*75 | |
| 492 | bv.Name = "MOVE" | |
| 493 | Debris:AddItem(bv,0.05) | |
| 494 | coroutine.resume(coroutine.create(function() | |
| 495 | local HASTOUCHEDGROUND = false | |
| 496 | local HIT = BLOOD.Touched:Connect(function(hit) | |
| 497 | if hit.Anchored == true then | |
| 498 | HASTOUCHEDGROUND = true | |
| 499 | PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize) | |
| 500 | end | |
| 501 | end) | |
| 502 | wait(5) | |
| 503 | if HASTOUCHEDGROUND == false then | |
| 504 | BLOOD:remove() | |
| 505 | end | |
| 506 | end)) | |
| 507 | end | |
| 508 | ||
| 509 | Debris = game:GetService("Debris")
| |
| 510 | ||
| 511 | function CastProperRay(StartPos, EndPos, Distance, Ignore) | |
| 512 | local DIRECTION = CF(StartPos,EndPos).lookVector | |
| 513 | return Raycast(StartPos, DIRECTION, Distance, Ignore) | |
| 514 | end | |
| 515 | ||
| 516 | function turnto(position) | |
| 517 | RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0) | |
| 518 | end | |
| 519 | ||
| 520 | function recurse(root,callback,i) | |
| 521 | i= i or 0 | |
| 522 | for _,v in pairs(root:GetChildren()) do | |
| 523 | i = i + 1 | |
| 524 | callback(i,v) | |
| 525 | ||
| 526 | if #v:GetChildren() > 0 then | |
| 527 | i = recurse(v,callback,i) | |
| 528 | end | |
| 529 | end | |
| 530 | ||
| 531 | return i | |
| 532 | end | |
| 533 | ||
| 534 | function ragdollJoint(character, part0, part1, attachmentName, className, properties) | |
| 535 | attachmentName = attachmentName.."RigAttachment" | |
| 536 | local constraint = Instance.new(className.."Constraint") | |
| 537 | constraint.Attachment0 = part0:FindFirstChild(attachmentName) | |
| 538 | constraint.Attachment1 = part1:FindFirstChild(attachmentName) | |
| 539 | constraint.Name = "RagdollConstraint"..part1.Name | |
| 540 | ||
| 541 | for _,propertyData in next,properties or {} do
| |
| 542 | constraint[propertyData[1]] = propertyData[2] | |
| 543 | end | |
| 544 | ||
| 545 | constraint.Parent = character | |
| 546 | end | |
| 547 | ||
| 548 | function getAttachment0(character, attachmentName) | |
| 549 | for _,child in next,character:GetChildren() do | |
| 550 | local attachment = child:FindFirstChild(attachmentName) | |
| 551 | if attachment then | |
| 552 | return attachment | |
| 553 | end | |
| 554 | end | |
| 555 | end | |
| 556 | ||
| 557 | function R15Ragdoll(character) | |
| 558 | recurse(character, function(_,v) | |
| 559 | if v:IsA("Attachment") then
| |
| 560 | v.Axis = Vector3.new(0, 1, 0) | |
| 561 | v.SecondaryAxis = Vector3.new(0, 0, 1) | |
| 562 | v.Rotation = Vector3.new(0, 0, 0) | |
| 563 | end | |
| 564 | end) | |
| 565 | for _,child in next,character:GetChildren() do | |
| 566 | if child:IsA("Accoutrement") then
| |
| 567 | for _,part in next,child:GetChildren() do | |
| 568 | if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
| |
| 569 | local attachment1 = part:FindFirstChildOfClass("Attachment")
| |
| 570 | local attachment0 = getAttachment0(character,attachment1.Name) | |
| 571 | if attachment0 and attachment1 then | |
| 572 | local constraint = Instance.new("HingeConstraint")
| |
| 573 | constraint.Attachment0 = attachment0 | |
| 574 | constraint.Attachment1 = attachment1 | |
| 575 | constraint.LimitsEnabled = true | |
| 576 | constraint.UpperAngle = 0 | |
| 577 | constraint.LowerAngle = 0 | |
| 578 | constraint.Parent = character | |
| 579 | end | |
| 580 | elseif part.Name == "HumanoidRootPart" then | |
| 581 | part:remove() | |
| 582 | end | |
| 583 | end | |
| 584 | end | |
| 585 | end | |
| 586 | ||
| 587 | ragdollJoint(character,character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
| |
| 588 | {"LimitsEnabled",true};
| |
| 589 | {"UpperAngle",5};
| |
| 590 | }) | |
| 591 | ragdollJoint(character,character.UpperTorso, character.Head, "Neck", "BallSocket", {
| |
| 592 | {"LimitsEnabled",true};
| |
| 593 | {"UpperAngle",15};
| |
| 594 | }) | |
| 595 | ||
| 596 | local handProperties = {
| |
| 597 | {"LimitsEnabled", true};
| |
| 598 | {"UpperAngle",0};
| |
| 599 | {"LowerAngle",0};
| |
| 600 | } | |
| 601 | ragdollJoint(character,character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties) | |
| 602 | ragdollJoint(character,character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties) | |
| 603 | ||
| 604 | local shinProperties = {
| |
| 605 | {"LimitsEnabled", true};
| |
| 606 | {"UpperAngle", 0};
| |
| 607 | {"LowerAngle", -75};
| |
| 608 | } | |
| 609 | ragdollJoint(character,character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties) | |
| 610 | ragdollJoint(character,character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties) | |
| 611 | ||
| 612 | local footProperties = {
| |
| 613 | {"LimitsEnabled", true};
| |
| 614 | {"UpperAngle", 15};
| |
| 615 | {"LowerAngle", -45};
| |
| 616 | } | |
| 617 | ragdollJoint(character,character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties) | |
| 618 | ragdollJoint(character,character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties) | |
| 619 | ||
| 620 | ragdollJoint(character,character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket") | |
| 621 | ragdollJoint(character,character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket") | |
| 622 | ragdollJoint(character,character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket") | |
| 623 | ragdollJoint(character,character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket") | |
| 624 | ragdollJoint(character,character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket") | |
| 625 | ragdollJoint(character,character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket") | |
| 626 | end | |
| 627 | ||
| 628 | function Ragdoll(Character2,CharTorso) | |
| 629 | Character2:BreakJoints() | |
| 630 | local hum = Character2:findFirstChild("Humanoid")
| |
| 631 | hum:remove() | |
| 632 | local function Scan(ch) | |
| 633 | local e | |
| 634 | for e = 1,#ch do | |
| 635 | Scan(ch[e]:GetChildren()) | |
| 636 | if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then | |
| 637 | ch[e]:remove() | |
| 638 | end | |
| 639 | end | |
| 640 | end | |
| 641 | local NEWHUM = IT("Humanoid")
| |
| 642 | NEWHUM.Name = "Corpse" | |
| 643 | NEWHUM.Health = 0 | |
| 644 | NEWHUM.MaxHealth = 0 | |
| 645 | NEWHUM.PlatformStand = true | |
| 646 | NEWHUM.Parent = Character2 | |
| 647 | NEWHUM.DisplayDistanceType = "None" | |
| 648 | ||
| 649 | local ch = Character2:GetChildren() | |
| 650 | local i | |
| 651 | for i = 1,#ch do | |
| 652 | if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then | |
| 653 | ch[i]:remove() | |
| 654 | end | |
| 655 | end | |
| 656 | ||
| 657 | local Torso2 = Character2.Torso | |
| 658 | local movevector = Vector3.new() | |
| 659 | ||
| 660 | if Torso2 then | |
| 661 | movevector = CFrame.new(CharTorso.Position,Torso2.Position).lookVector | |
| 662 | local Head = Character2:FindFirstChild("Head")
| |
| 663 | if Head then | |
| 664 | local Neck = Instance.new("Weld")
| |
| 665 | Neck.Name = "Neck" | |
| 666 | Neck.Part0 = Torso2 | |
| 667 | Neck.Part1 = Head | |
| 668 | Neck.C0 = CFrame.new(0, 1.5, 0) | |
| 669 | Neck.C1 = CFrame.new() | |
| 670 | Neck.Parent = Torso2 | |
| 671 | ||
| 672 | end | |
| 673 | local Limb = Character2:FindFirstChild("Right Arm")
| |
| 674 | if Limb then | |
| 675 | ||
| 676 | Limb.CFrame = Torso2.CFrame * CFrame.new(1.5, 0, 0) | |
| 677 | local Joint = Instance.new("Glue")
| |
| 678 | Joint.Name = "RightShoulder" | |
| 679 | Joint.Part0 = Torso2 | |
| 680 | Joint.Part1 = Limb | |
| 681 | Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 682 | Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 683 | Joint.Parent = Torso2 | |
| 684 | ||
| 685 | local B = Instance.new("Part")
| |
| 686 | B.TopSurface = 0 | |
| 687 | B.BottomSurface = 0 | |
| 688 | B.formFactor = "Symmetric" | |
| 689 | B.Size = Vector3.new(1, 1, 1) | |
| 690 | B.Transparency = 1 | |
| 691 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 692 | B.Parent = Character2 | |
| 693 | local W = Instance.new("Weld")
| |
| 694 | W.Part0 = Limb | |
| 695 | W.Part1 = B | |
| 696 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 697 | W.Parent = Limb | |
| 698 | ||
| 699 | end | |
| 700 | local Limb = Character2:FindFirstChild("Left Arm")
| |
| 701 | if Limb then | |
| 702 | ||
| 703 | Limb.CFrame = Torso2.CFrame * CFrame.new(-1.5, 0, 0) | |
| 704 | local Joint = Instance.new("Glue")
| |
| 705 | Joint.Name = "LeftShoulder" | |
| 706 | Joint.Part0 = Torso2 | |
| 707 | Joint.Part1 = Limb | |
| 708 | Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 709 | Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 710 | Joint.Parent = Torso2 | |
| 711 | ||
| 712 | local B = Instance.new("Part")
| |
| 713 | B.TopSurface = 0 | |
| 714 | B.BottomSurface = 0 | |
| 715 | B.formFactor = "Symmetric" | |
| 716 | B.Size = Vector3.new(1, 1, 1) | |
| 717 | B.Transparency = 1 | |
| 718 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 719 | B.Parent = Character2 | |
| 720 | local W = Instance.new("Weld")
| |
| 721 | W.Part0 = Limb | |
| 722 | W.Part1 = B | |
| 723 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 724 | W.Parent = Limb | |
| 725 | ||
| 726 | end | |
| 727 | local Limb = Character2:FindFirstChild("Right Leg")
| |
| 728 | if Limb then | |
| 729 | ||
| 730 | Limb.CFrame = Torso2.CFrame * CFrame.new(0.5, -2, 0) | |
| 731 | local Joint = Instance.new("Glue")
| |
| 732 | Joint.Name = "RightHip" | |
| 733 | Joint.Part0 = Torso2 | |
| 734 | Joint.Part1 = Limb | |
| 735 | Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 736 | Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 737 | Joint.Parent = Torso2 | |
| 738 | ||
| 739 | local B = Instance.new("Part")
| |
| 740 | B.TopSurface = 0 | |
| 741 | B.BottomSurface = 0 | |
| 742 | B.formFactor = "Symmetric" | |
| 743 | B.Size = Vector3.new(1, 1, 1) | |
| 744 | B.Transparency = 1 | |
| 745 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 746 | B.Parent = Character2 | |
| 747 | local W = Instance.new("Weld")
| |
| 748 | W.Part0 = Limb | |
| 749 | W.Part1 = B | |
| 750 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 751 | W.Parent = Limb | |
| 752 | ||
| 753 | end | |
| 754 | local Limb = Character2:FindFirstChild("Left Leg")
| |
| 755 | if Limb then | |
| 756 | ||
| 757 | Limb.CFrame = Torso2.CFrame * CFrame.new(-0.5, -2, 0) | |
| 758 | local Joint = Instance.new("Glue")
| |
| 759 | Joint.Name = "LeftHip" | |
| 760 | Joint.Part0 = Torso2 | |
| 761 | Joint.Part1 = Limb | |
| 762 | Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 763 | Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 764 | Joint.Parent = Torso2 | |
| 765 | ||
| 766 | local B = Instance.new("Part")
| |
| 767 | B.TopSurface = 0 | |
| 768 | B.BottomSurface = 0 | |
| 769 | B.formFactor = "Symmetric" | |
| 770 | B.Size = Vector3.new(1, 1, 1) | |
| 771 | B.Transparency = 1 | |
| 772 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 773 | B.Parent = Character2 | |
| 774 | local W = Instance.new("Weld")
| |
| 775 | W.Part0 = Limb | |
| 776 | W.Part1 = B | |
| 777 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 778 | W.Parent = Limb | |
| 779 | ||
| 780 | end | |
| 781 | --[ | |
| 782 | local Bar = Instance.new("Part")
| |
| 783 | Bar.TopSurface = 0 | |
| 784 | Bar.BottomSurface = 0 | |
| 785 | Bar.formFactor = "Symmetric" | |
| 786 | Bar.Size = Vector3.new(1, 1, 1) | |
| 787 | Bar.Transparency = 1 | |
| 788 | Bar.CFrame = Torso2.CFrame * CFrame.new(0, 0.5, 0) | |
| 789 | Bar.Parent = Character2 | |
| 790 | local Weld = Instance.new("Weld")
| |
| 791 | Weld.Part0 = Torso2 | |
| 792 | Weld.Part1 = Bar | |
| 793 | Weld.C0 = CFrame.new(0, 0.5, 0) | |
| 794 | Weld.Parent = Torso2 | |
| 795 | --]] | |
| 796 | end | |
| 797 | Character2.Parent = workspace | |
| 798 | Debris:AddItem(Character2,5) | |
| 799 | ||
| 800 | return Character2,Torso2 | |
| 801 | end | |
| 802 | ||
| 803 | --//=================================\\ | |
| 804 | --|| WEAPON CREATION | |
| 805 | --\\=================================// | |
| 806 | ||
| 807 | local Knife = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.2,1.2,0.2),false) | |
| 808 | local Grip = CreateWeldOrSnapOrMotor("Weld", RightArm, RightArm, Knife, CF(0,-1.2, -0.5) * ANGLES(RAD(0), RAD(0), RAD(180)) * ANGLES(RAD(45), RAD(0), RAD(0)), CF(0, 0.3, 0))
| |
| 809 | CreateMesh("SpecialMesh", Knife, "FileMesh", "470094777", "470149026", VT(0.2,0.2,0.2), VT(0,0,0))
| |
| 810 | local A = IT("Attachment",Knife)
| |
| 811 | A.Position = VT(-0, 0.2, 0.136) | |
| 812 | local B = IT("Attachment",Knife)
| |
| 813 | B.Position = VT(-0, -0.95, -0.982) | |
| 814 | local Trail = IT("Trail",Knife)
| |
| 815 | Trail.Attachment0 = B | |
| 816 | Trail.Attachment1 = A | |
| 817 | Trail.Lifetime = 0.1 | |
| 818 | Trail.Transparency = NumberSequence.new(0.5, 1) | |
| 819 | Trail.Texture = "http://www.roblox.com/asset/?id=1472703539" | |
| 820 | Trail.Enabled = true | |
| 821 | Humanoid.DisplayDistanceType = "None" | |
| 822 | Humanoid.MaxHealth = 800 | |
| 823 | Humanoid.Health = 800 | |
| 824 | ||
| 825 | local STEP = CreateSound(131436155, Torso, 3, 1, true) | |
| 826 | STEP.Playing = false | |
| 827 | STEP.Looped = false | |
| 828 | local STEPPING = false | |
| 829 | Humanoid.Running:Connect(function(speed) | |
| 830 | if STEPPING == false then | |
| 831 | STEPPING = true | |
| 832 | repeat | |
| 833 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
| 834 | wait(8/TORSOVELOCITY) | |
| 835 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
| 836 | if TORSOVELOCITY > 1 and Torso.Transparency ~= 1 and HITFLOOR ~= nil then | |
| 837 | STEP.Parent = Torso | |
| 838 | STEP.Pitch = MRANDOM(8,12)/10 | |
| 839 | STEP:Play() | |
| 840 | end | |
| 841 | until TORSOVELOCITY < 0.6 | |
| 842 | STEPPING = false | |
| 843 | end | |
| 844 | end) | |
| 845 | ||
| 846 | for _, c in pairs(Weapon:GetChildren()) do | |
| 847 | if c.ClassName == "Part" then | |
| 848 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
| 849 | end | |
| 850 | end | |
| 851 | ||
| 852 | local SKILLTEXTCOLOR = C3(0,0,0) | |
| 853 | local SKILLFONT = "SciFi" | |
| 854 | local SKILLTEXTSIZE = 7 | |
| 855 | ||
| 856 | Weapon.Parent = Character | |
| 857 | ||
| 858 | Humanoid.Died:connect(function() | |
| 859 | ATTACK = true | |
| 860 | end) | |
| 861 | ||
| 862 | --//=================================\\ | |
| 863 | --|| DAMAGE FUNCTIONS | |
| 864 | --\\=================================// | |
| 865 | ||
| 866 | function StatLabel(CFRAME, TEXT, COLOR) | |
| 867 | local STATPART = CreatePart(3, Effects, "SmoothPlastic", 0, 1, "Really black", "Effect", VT()) | |
| 868 | STATPART.CFrame = CF(CFRAME.p,CFRAME.p+VT(MRANDOM(-5,5),MRANDOM(0,5),MRANDOM(-5,5))) | |
| 869 | local BODYGYRO = IT("BodyGyro", STATPART)
| |
| 870 | game:GetService("Debris"):AddItem(STATPART ,5)
| |
| 871 | local BILLBOARDGUI = Instance.new("BillboardGui", STATPART)
| |
| 872 | BILLBOARDGUI.Adornee = STATPART | |
| 873 | BILLBOARDGUI.Size = UD2(2.5, 0, 2.5 ,0) | |
| 874 | BILLBOARDGUI.StudsOffset = VT(-2, 2, 0) | |
| 875 | BILLBOARDGUI.AlwaysOnTop = false | |
| 876 | local TEXTLABEL = Instance.new("TextLabel", BILLBOARDGUI)
| |
| 877 | TEXTLABEL.BackgroundTransparency = 1 | |
| 878 | TEXTLABEL.Size = UD2(2.5, 0, 2.5, 0) | |
| 879 | TEXTLABEL.Text = TEXT | |
| 880 | TEXTLABEL.Font = SKILLFONT | |
| 881 | TEXTLABEL.FontSize="Size42" | |
| 882 | TEXTLABEL.TextColor3 = COLOR | |
| 883 | TEXTLABEL.TextStrokeTransparency = 0 | |
| 884 | TEXTLABEL.TextScaled = true | |
| 885 | TEXTLABEL.TextWrapped = true | |
| 886 | coroutine.resume(coroutine.create(function(THEPART, THEBODYPOSITION, THETEXTLABEL) | |
| 887 | for i = 1, 50 do | |
| 888 | Swait() | |
| 889 | STATPART.CFrame = STATPART.CFrame * CF(0,0,-0.2) | |
| 890 | TEXTLABEL.TextTransparency = TEXTLABEL.TextTransparency + (1/50) | |
| 891 | TEXTLABEL.TextStrokeTransparency = TEXTLABEL.TextTransparency | |
| 892 | end | |
| 893 | THEPART.Parent = nil | |
| 894 | end),STATPART, TEXTLABEL) | |
| 895 | end | |
| 896 | ||
| 897 | --//=================================\\ | |
| 898 | --|| DAMAGING | |
| 899 | --\\=================================// | |
| 900 | ||
| 901 | function ApplyDamage(Humanoid,Damage,TorsoPart) | |
| 902 | local defence = Instance.new("BoolValue",Humanoid.Parent)
| |
| 903 | defence.Name = ("HitBy"..Player.Name)
| |
| 904 | game:GetService("Debris"):AddItem(defence, 0.001)
| |
| 905 | Damage = Damage * DAMAGEMULTIPLIER | |
| 906 | if Humanoid.Health ~= 0 then | |
| 907 | local CritChance = MRANDOM(1,100) | |
| 908 | if Damage > Humanoid.Health then | |
| 909 | Damage = math.ceil(Humanoid.Health) | |
| 910 | if Damage == 0 then | |
| 911 | Damage = 0.1 | |
| 912 | end | |
| 913 | end | |
| 914 | Humanoid.Health = Humanoid.Health - Damage | |
| 915 | StatLabel(TorsoPart.CFrame * CF(0, 0 + (TorsoPart.Size.z - 1), 0), Damage, C3(0, 0, 0)) | |
| 916 | end | |
| 917 | end | |
| 918 | ||
| 919 | function ApplyAoE(POSITION,RANGE,MINDMG,MAXDMG,FLING,INSTAKILL) | |
| 920 | local CHILDREN = workspace:GetDescendants() | |
| 921 | for index, CHILD in pairs(CHILDREN) do | |
| 922 | if CHILD.ClassName == "Model" and CHILD ~= Character then | |
| 923 | local HUM = CHILD:FindFirstChildOfClass("Humanoid")
| |
| 924 | if HUM then | |
| 925 | local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
| |
| 926 | if TORSO then | |
| 927 | if (TORSO.Position - POSITION).Magnitude <= RANGE then | |
| 928 | if INSTAKILL == true then | |
| 929 | CHILD:BreakJoints() | |
| 930 | else | |
| 931 | local DMG = MRANDOM(MINDMG,MAXDMG) | |
| 932 | ApplyDamage(HUM,DMG,TORSO) | |
| 933 | end | |
| 934 | if FLING > 0 then | |
| 935 | for _, c in pairs(CHILD:GetChildren()) do | |
| 936 | if c:IsA("BasePart") then
| |
| 937 | local bv = Instance.new("BodyVelocity")
| |
| 938 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
| 939 | bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING | |
| 940 | bv.Parent = c | |
| 941 | Debris:AddItem(bv,0.05) | |
| 942 | end | |
| 943 | end | |
| 944 | end | |
| 945 | end | |
| 946 | end | |
| 947 | end | |
| 948 | end | |
| 949 | end | |
| 950 | end | |
| 951 | ||
| 952 | --//=================================\\ | |
| 953 | --|| ATTACK FUNCTIONS AND STUFF | |
| 954 | --\\=================================// | |
| 955 | ||
| 956 | function Cloaked() | |
| 957 | CLOAKED = true | |
| 958 | Speed = 0 | |
| 959 | local POS = RootPart.Position | |
| 960 | local DISTANCE = 99999 | |
| 961 | for i = 1, 15 do | |
| 962 | wait() | |
| 963 | for _, c in pairs(Character:GetChildren()) do | |
| 964 | if c:IsA("BasePart") and c ~= RootPart then
| |
| 965 | c.Transparency = c.Transparency + 1/15 | |
| 966 | elseif c.ClassName == "Accessory" then | |
| 967 | c.Handle.Transparency = c.Handle.Transparency + 1/15 | |
| 968 | end | |
| 969 | end | |
| 970 | Trail.Transparency = NumberSequence.new(0.5+((i/15)/2), 1) | |
| 971 | Knife.Transparency = Knife.Transparency + 1/15 | |
| 972 | end | |
| 973 | Speed = 5 | |
| 974 | repeat | |
| 975 | wait() | |
| 976 | DISTANCE = (RootPart.Position - POS).Magnitude | |
| 977 | until DISTANCE > 45 or CLOAKED == false | |
| 978 | Speed = 0 | |
| 979 | for i = 1, 15 do | |
| 980 | wait() | |
| 981 | for _, c in pairs(Character:GetChildren()) do | |
| 982 | if c:IsA("BasePart") and c ~= RootPart then
| |
| 983 | c.Transparency = 1 - i/15 | |
| 984 | elseif c.ClassName == "Accessory" then | |
| 985 | c.Handle.Transparency = 1 - i/15 | |
| 986 | end | |
| 987 | end | |
| 988 | Trail.Transparency = NumberSequence.new(1-((0.5/15)*i), 1) | |
| 989 | Knife.Transparency = 1 - i/15 | |
| 990 | end | |
| 991 | Speed = 12 | |
| 992 | CLOAKED = false | |
| 993 | end | |
| 994 | ||
| 995 | function Attack() | |
| 996 | PLAYANIMS = false | |
| 997 | ATTACK = true | |
| 998 | Rooted = false | |
| 999 | local TARGET = nil | |
| 1000 | Knife.CanCollide = true | |
| 1001 | local HUMAN = nil | |
| 1002 | local TORSOPART = nil | |
| 1003 | local HIT = Knife.Touched:Connect(function(hit) | |
| 1004 | if hit.Parent:FindFirstChildOfClass("Humanoid") then
| |
| 1005 | local HITBODY = hit.Parent | |
| 1006 | local HUM = hit.Parent:FindFirstChildOfClass("Humanoid")
| |
| 1007 | local TORSO = HITBODY:FindFirstChild("Torso") or HITBODY:FindFirstChild("UpperTorso")
| |
| 1008 | if TORSO and HUM.Health > 0 then | |
| 1009 | TARGET = HITBODY | |
| 1010 | TORSOPART = TORSO | |
| 1011 | HUMAN = HUM | |
| 1012 | end | |
| 1013 | end | |
| 1014 | end) | |
| 1015 | for i=0, 0.4, 0.1 / Animation_Speed do | |
| 1016 | Swait() | |
| 1017 | if TARGET then | |
| 1018 | break | |
| 1019 | end | |
| 1020 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 1 / Animation_Speed) | |
| 1021 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(15)), 1 / Animation_Speed) | |
| 1022 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
| 1023 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
| 1024 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1025 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1026 | end | |
| 1027 | CreateSound(1238804383,Knife,2,MRANDOM(8,13)/10,false) | |
| 1028 | for i=0, 0.5, 0.1 / Animation_Speed do | |
| 1029 | Swait() | |
| 1030 | if TARGET then | |
| 1031 | break | |
| 1032 | end | |
| 1033 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(35)), 1 / Animation_Speed) | |
| 1034 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(-35)), 1 / Animation_Speed) | |
| 1035 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.15, 0.5, -0.4) * ANGLES(RAD(90), RAD(0), RAD(35)) * ANGLES(RAD(0), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
| 1036 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.5, -0.3) * ANGLES(RAD(90), RAD(0), RAD(35)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
| 1037 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1038 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1039 | end | |
| 1040 | Knife.CanCollide = false | |
| 1041 | if TARGET then | |
| 1042 | CLOAKED = false | |
| 1043 | local DISPOSE = false | |
| 1044 | Rooted = true | |
| 1045 | coroutine.resume(coroutine.create(function() | |
| 1046 | repeat | |
| 1047 | Swait() | |
| 1048 | if TORSOPART then | |
| 1049 | TORSOPART.Anchored = true | |
| 1050 | TORSOPART.CFrame = RootPart.CFrame*CF(0,0,-2.2) | |
| 1051 | end | |
| 1052 | until DISPOSE == true | |
| 1053 | TORSOPART.Anchored = false | |
| 1054 | end)) | |
| 1055 | for i=0, 0.5, 0.1 / Animation_Speed do | |
| 1056 | Swait() | |
| 1057 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 1 / Animation_Speed) | |
| 1058 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(15)), 1 / Animation_Speed) | |
| 1059 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.15, 0.75, -1.3) * ANGLES(RAD(90), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
| 1060 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
| 1061 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1062 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1063 | end | |
| 1064 | CreateSound(546410481,Knife,6,MRANDOM(8,13)/10,false) | |
| 1065 | CreateSound(130944130,TORSOPART,5,MRANDOM(8,13)/10,false) | |
| 1066 | coroutine.resume(coroutine.create(function() | |
| 1067 | for i = 1, 750 do | |
| 1068 | Swait() | |
| 1069 | if HUMAN and TORSOPART then | |
| 1070 | if HUMAN.Health > 0 then | |
| 1071 | SprayBlood(TORSOPART.CFrame*CF(0,TORSOPART.Size.Y/2,-TORSOPART.Size.Z/2).p,TORSOPART.CFrame*CF(MRANDOM(-3,3)/15,TORSOPART.Size.Y+MRANDOM(-3,3)/35,-TORSOPART.Size.Z*MRANDOM(8,25)/10).p,MRANDOM(15,35)/10) | |
| 1072 | HUMAN.Health = HUMAN.Health - 1 | |
| 1073 | HUMAN.WalkSpeed = MRANDOM(5,45) | |
| 1074 | else | |
| 1075 | break | |
| 1076 | end | |
| 1077 | else | |
| 1078 | break | |
| 1079 | end | |
| 1080 | end | |
| 1081 | local SCREAMS = {684194079,899623922}
| |
| 1082 | if HUMAN and TORSOPART then | |
| 1083 | if HUMAN.Health == 0 then | |
| 1084 | local HEAD = TORSOPART.Parent:FindFirstChild("Head")
| |
| 1085 | if HEAD then | |
| 1086 | CreateSound(SCREAMS[MRANDOM(1,#SCREAMS)],HEAD,5,MRANDOM(10,10)/10,false) | |
| 1087 | local FACE = HEAD:FindFirstChild("face")
| |
| 1088 | if FACE then | |
| 1089 | FACE.Texture = "http://www.roblox.com/asset/?id=1264583472" | |
| 1090 | end | |
| 1091 | end | |
| 1092 | if TORSOPART.Name == "Torso" then | |
| 1093 | Ragdoll(TORSOPART.Parent,Torso) | |
| 1094 | elseif TORSOPART.Name == "UpperTorso" then | |
| 1095 | R15Ragdoll(TORSOPART.Parent) | |
| 1096 | end | |
| 1097 | end | |
| 1098 | HUMAN.WalkSpeed = 16 | |
| 1099 | end | |
| 1100 | end)) | |
| 1101 | for i=0, 0.2, 0.1 / Animation_Speed do | |
| 1102 | Swait() | |
| 1103 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 1 / Animation_Speed) | |
| 1104 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(15)), 1 / Animation_Speed) | |
| 1105 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(2, 0.75, -1.3) * ANGLES(RAD(90), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
| 1106 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
| 1107 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1108 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1109 | end | |
| 1110 | DISPOSE = true | |
| 1111 | local bv = Instance.new("BodyVelocity")
| |
| 1112 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
| 1113 | bv.velocity = CF(TORSOPART.Position,TORSOPART.CFrame*CF(0,5,-15).p).lookVector*75 | |
| 1114 | bv.Parent = TORSOPART | |
| 1115 | Debris:AddItem(bv,0.05) | |
| 1116 | for i=0, 0.5, 0.1 / Animation_Speed do | |
| 1117 | Swait() | |
| 1118 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-35)), 1 / Animation_Speed) | |
| 1119 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(35)), 1 / Animation_Speed) | |
| 1120 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(-25), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
| 1121 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.15, 0.5, -0.5) * ANGLES(RAD(90), RAD(0), RAD(-35)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
| 1122 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(110), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1123 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-65), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1124 | end | |
| 1125 | end | |
| 1126 | HIT:disconnect() | |
| 1127 | ATTACK = false | |
| 1128 | Rooted = false | |
| 1129 | PLAYANIMS = true | |
| 1130 | end | |
| 1131 | ||
| 1132 | function Taunt() | |
| 1133 | ATTACK = true | |
| 1134 | Rooted = true | |
| 1135 | PLAYANIMS = false | |
| 1136 | CreateSound(1330508600,Torso,5,MRANDOM(10,10)/10,false) | |
| 1137 | for i=0, 1.5, 0.1 / Animation_Speed do | |
| 1138 | Swait() | |
| 1139 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1140 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(35), RAD(0)), 1 / Animation_Speed) | |
| 1141 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(140)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
| 1142 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-140)) * ANGLES(RAD(0), RAD(90), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
| 1143 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1144 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
| 1145 | end | |
| 1146 | PLAYANIMS = true | |
| 1147 | ATTACK = false | |
| 1148 | Rooted = false | |
| 1149 | end | |
| 1150 | ||
| 1151 | --//=================================\\ | |
| 1152 | --|| ASSIGN THINGS TO KEYS | |
| 1153 | --\\=================================// | |
| 1154 | ||
| 1155 | function MouseDown(Mouse) | |
| 1156 | HOLD = true | |
| 1157 | if ATTACK == false then | |
| 1158 | Attack() | |
| 1159 | end | |
| 1160 | end | |
| 1161 | ||
| 1162 | function MouseUp(Mouse) | |
| 1163 | HOLD = false | |
| 1164 | end | |
| 1165 | ||
| 1166 | function KeyDown(Key) | |
| 1167 | KEYHOLD = true | |
| 1168 | if Key == "z" and ATTACK == false then | |
| 1169 | if CLOAKED == false then | |
| 1170 | Cloaked() | |
| 1171 | else | |
| 1172 | CLOAKED = false | |
| 1173 | end | |
| 1174 | end | |
| 1175 | ||
| 1176 | if Key == "t" and ATTACK == false then | |
| 1177 | Taunt() | |
| 1178 | end | |
| 1179 | ||
| 1180 | if string.byte(Key) == 50 and ATTACK == false and CLOAKED == false then | |
| 1181 | if Speed == 12 then | |
| 1182 | Speed = 30 | |
| 1183 | elseif Speed == 30 then | |
| 1184 | Speed = 12 | |
| 1185 | end | |
| 1186 | end | |
| 1187 | end | |
| 1188 | ||
| 1189 | function KeyUp(Key) | |
| 1190 | KEYHOLD = false | |
| 1191 | end | |
| 1192 | ||
| 1193 | Mouse.Button1Down:connect(function(NEWKEY) | |
| 1194 | MouseDown(NEWKEY) | |
| 1195 | end) | |
| 1196 | Mouse.Button1Up:connect(function(NEWKEY) | |
| 1197 | MouseUp(NEWKEY) | |
| 1198 | end) | |
| 1199 | Mouse.KeyDown:connect(function(NEWKEY) | |
| 1200 | KeyDown(NEWKEY) | |
| 1201 | end) | |
| 1202 | Mouse.KeyUp:connect(function(NEWKEY) | |
| 1203 | KeyUp(NEWKEY) | |
| 1204 | end) | |
| 1205 | ||
| 1206 | --//=================================\\ | |
| 1207 | --\\=================================// | |
| 1208 | ||
| 1209 | function unanchor() | |
| 1210 | if UNANCHOR == true then | |
| 1211 | g = Character:GetChildren() | |
| 1212 | for i = 1, #g do | |
| 1213 | if g[i].ClassName == "Part" then | |
| 1214 | g[i].Anchored = false | |
| 1215 | end | |
| 1216 | end | |
| 1217 | end | |
| 1218 | end | |
| 1219 | ||
| 1220 | --//=================================\\ | |
| 1221 | --|| WRAP THE WHOLE SCRIPT UP | |
| 1222 | --\\=================================// | |
| 1223 | ||
| 1224 | Humanoid.Changed:connect(function(Jump) | |
| 1225 | if Jump == "Jump" and (Disable_Jump == true) then | |
| 1226 | Humanoid.Jump = false | |
| 1227 | end | |
| 1228 | end) | |
| 1229 | ||
| 1230 | while true do | |
| 1231 | Swait() | |
| 1232 | script.Parent = WEAPONGUI | |
| 1233 | ANIMATE.Parent = nil | |
| 1234 | for _,v in next, Humanoid:GetPlayingAnimationTracks() do | |
| 1235 | v:Stop(); | |
| 1236 | end | |
| 1237 | SINE = SINE + CHANGE | |
| 1238 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
| 1239 | local TORSOVERTICALVELOCITY = RootPart.Velocity.y | |
| 1240 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
| 1241 | local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16) | |
| 1242 | if ANIM == "Walk" and TORSOVELOCITY > 1 then | |
| 1243 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
| 1244 | Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(2.5 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
| 1245 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
| 1246 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
| 1247 | elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then | |
| 1248 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1249 | Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1250 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1251 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1252 | end | |
| 1253 | if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then | |
| 1254 | ANIM = "Jump" | |
| 1255 | if PLAYANIMS == true then | |
| 1256 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1257 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1258 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
| 1259 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
| 1260 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.3) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(-20)), 0.2 / Animation_Speed) | |
| 1261 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(20)), 0.2 / Animation_Speed) | |
| 1262 | end | |
| 1263 | elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then | |
| 1264 | ANIM = "Fall" | |
| 1265 | if PLAYANIMS == true then | |
| 1266 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1267 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
| 1268 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(60)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
| 1269 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
| 1270 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.2 / Animation_Speed) | |
| 1271 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 0.2 / Animation_Speed) | |
| 1272 | end | |
| 1273 | elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then | |
| 1274 | ANIM = "Idle" | |
| 1275 | if PLAYANIMS == true then | |
| 1276 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
| 1277 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
| 1278 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(15), RAD(35), RAD(12)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed) | |
| 1279 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.15 / Animation_Speed) | |
| 1280 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
| 1281 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
| 1282 | end | |
| 1283 | elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then | |
| 1284 | ANIM = "Walk" | |
| 1285 | if PLAYANIMS == true then | |
| 1286 | if Humanoid.WalkSpeed <= 17 then | |
| 1287 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
| 1288 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
| 1289 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(20 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(5)) * RIGHTSHOULDERC0, 0.35 / Animation_Speed) | |
| 1290 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-20 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 0.35 / Animation_Speed) | |
| 1291 | RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 2 / Animation_Speed) | |
| 1292 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(15)), 2 / Animation_Speed) | |
| 1293 | else | |
| 1294 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1) * ANGLES(RAD(35), RAD(0), RAD(5 * SIN(SINE / (WALKSPEEDVALUE / 2)))), 0.15 / Animation_Speed) | |
| 1295 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-25 - 1 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(-5 * SIN(SINE / (WALKSPEEDVALUE / 2)))), 0.15 / Animation_Speed) | |
| 1296 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, -0.2) * ANGLES(RAD(0), RAD(35), RAD(0)) * ANGLES(RAD(35+20 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(5)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
| 1297 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, -0.2) * ANGLES(RAD(0), RAD(-35), RAD(0)) * ANGLES(RAD(35-60 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
| 1298 | RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(5)), 2 / Animation_Speed) | |
| 1299 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-5)), 2 / Animation_Speed) | |
| 1300 | end | |
| 1301 | end | |
| 1302 | end | |
| 1303 | unanchor() | |
| 1304 | if Rooted == false then | |
| 1305 | Disable_Jump = false | |
| 1306 | Humanoid.WalkSpeed = Speed | |
| 1307 | elseif Rooted == true then | |
| 1308 | Disable_Jump = true | |
| 1309 | Humanoid.WalkSpeed = 0 | |
| 1310 | end | |
| 1311 | if Head:FindFirstChild("face") then
| |
| 1312 | - | face.Texture = "http://www.roblox.com/asset/?id=1264583472" |
| 1312 | + | Head.face:remove() |
| 1313 | elseif Head:FindFirstChildOfClass("Sound") then
| |
| 1314 | Head:FindFirstChildOfClass("Sound"):remove()
| |
| 1315 | end | |
| 1316 | Humanoid.Health = Humanoid.Health + 1 | |
| 1317 | end | |
| 1318 | ||
| 1319 | --//=================================\\ | |
| 1320 | --\\=================================// | |
| 1321 | ||
| 1322 | ||
| 1323 | ||
| 1324 | ||
| 1325 | ||
| 1326 | --//====================================================\\-- | |
| 1327 | --|| END OF SCRIPT | |
| 1328 | --\\====================================================//-- |