SHOW:
|
|
- or go back to the newest paste.
| 1 | --https://github.com/Mokiros/roblox-FE-compatibility | |
| 2 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 3 | local Player,game,owner = owner,game | |
| 4 | local RealPlayer = Player | |
| 5 | do | |
| 6 | print("FE Compatibility code V2 by Mokiros")
| |
| 7 | local RealPlayer = RealPlayer | |
| 8 | script.Parent = RealPlayer.Character | |
| 9 | ||
| 10 | --Fake event to make stuff like Mouse.KeyDown work | |
| 11 | local Disconnect_Function = function(this) | |
| 12 | this[1].Functions[this[2]] = nil | |
| 13 | end | |
| 14 | local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
| |
| 15 | local FakeEvent_Metatable = {__index={
| |
| 16 | Connect = function(this,f) | |
| 17 | - | TimeStop = "rbxassetid://926382097", |
| 17 | + | local i = tostring(math.random(0,10000)) |
| 18 | while this.Functions[i] do | |
| 19 | i = tostring(math.random(0,10000)) | |
| 20 | - | TimeReverse = "rbxassetid://618737332", |
| 20 | + | |
| 21 | this.Functions[i] = f | |
| 22 | return setmetatable({this,i},Disconnect_Metatable)
| |
| 23 | end | |
| 24 | }} | |
| 25 | FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect | |
| 26 | local function fakeEvent() | |
| 27 | - | local mouse = plr:GetMouse() |
| 27 | + | return setmetatable({Functions={}},FakeEvent_Metatable)
|
| 28 | end | |
| 29 | ||
| 30 | --Creating fake input objects with fake variables | |
| 31 | local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
| |
| 32 | FakeMouse.keyUp = FakeMouse.KeyUp | |
| 33 | FakeMouse.keyDown = FakeMouse.KeyDown | |
| 34 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 35 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 36 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 37 | end} | |
| 38 | --Merged 2 functions into one by checking amount of arguments | |
| 39 | CAS.UnbindAction = CAS.BindAction | |
| 40 | ||
| 41 | --This function will trigger the events that have been :Connect()'ed | |
| 42 | local function TriggerEvent(self,ev,...) | |
| 43 | for _,f in pairs(self[ev].Functions) do | |
| 44 | f(...) | |
| 45 | end | |
| 46 | end | |
| 47 | FakeMouse.TriggerEvent = TriggerEvent | |
| 48 | UIS.TriggerEvent = TriggerEvent | |
| 49 | ||
| 50 | --Client communication | |
| 51 | local Event = Instance.new("RemoteEvent")
| |
| 52 | Event.Name = "UserInput_Event" | |
| 53 | Event.OnServerEvent:Connect(function(plr,io) | |
| 54 | if plr~=RealPlayer then return end | |
| 55 | FakeMouse.Target = io.Target | |
| 56 | FakeMouse.Hit = io.Hit | |
| 57 | if not io.isMouse then | |
| 58 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 59 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 60 | return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up") | |
| 61 | end | |
| 62 | if io.UserInputType == Enum.UserInputType.MouseButton2 then | |
| 63 | return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up") | |
| 64 | end | |
| 65 | for _,t in pairs(CAS.Actions) do | |
| 66 | for _,k in pairs(t.Keys) do | |
| 67 | if k==io.KeyCode then | |
| 68 | t.Function(t.Name,io.UserInputState,io) | |
| 69 | end | |
| 70 | end | |
| 71 | end | |
| 72 | FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 73 | UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 74 | end | |
| 75 | end) | |
| 76 | Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
| |
| 77 | local Mouse = owner:GetMouse() | |
| 78 | local UIS = game:GetService("UserInputService")
| |
| 79 | local input = function(io,RobloxHandled) | |
| 80 | if RobloxHandled then return end | |
| 81 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 82 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 83 | end | |
| 84 | UIS.InputBegan:Connect(input) | |
| 85 | UIS.InputEnded:Connect(input) | |
| 86 | local h,t | |
| 87 | --Give the server mouse data every second frame, but only if the values changed | |
| 88 | --If player is not moving their mouse, client won't fire events | |
| 89 | local HB = game:GetService("RunService").Heartbeat
| |
| 90 | while true do | |
| 91 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 92 | h,t=Mouse.Hit,Mouse.Target | |
| 93 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 94 | end | |
| 95 | --Wait 2 frames | |
| 96 | for i=1,2 do | |
| 97 | HB:Wait() | |
| 98 | end | |
| 99 | end]==],script) | |
| 100 | ||
| 101 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 102 | --Real game object | |
| 103 | local RealGame = game | |
| 104 | ||
| 105 | --Metatable for fake service | |
| 106 | local FakeService_Metatable = {
| |
| 107 | __index = function(self,k) | |
| 108 | local s = rawget(self,"_RealService") | |
| 109 | if s then | |
| 110 | return typeof(s[k])=="function" | |
| 111 | and function(_,...)return s[k](s,...)end or s[k] | |
| 112 | end | |
| 113 | end, | |
| 114 | __newindex = function(self,k,v) | |
| 115 | local s = rawget(self,"_RealService") | |
| 116 | if s then s[k]=v end | |
| 117 | end | |
| 118 | } | |
| 119 | local function FakeService(t,RealService) | |
| 120 | t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService | |
| 121 | return setmetatable(t,FakeService_Metatable) | |
| 122 | end | |
| 123 | ||
| 124 | --Fake game object | |
| 125 | local FakeGame = {
| |
| 126 | GetService = function(self,s) | |
| 127 | return rawget(self,s) or RealGame:GetService(s) | |
| 128 | end, | |
| 129 | Players = FakeService({
| |
| 130 | LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
| |
| 131 | },"Players"), | |
| 132 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 133 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 134 | RunService = FakeService({
| |
| 135 | _btrs = {},
| |
| 136 | RenderStepped = RealGame:GetService("RunService").Heartbeat,
| |
| 137 | BindToRenderStep = function(self,name,_,fun) | |
| 138 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 139 | end, | |
| 140 | UnbindFromRenderStep = function(self,name) | |
| 141 | self._btrs[name]:Disconnect() | |
| 142 | end, | |
| 143 | },"RunService") | |
| 144 | } | |
| 145 | rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer) | |
| 146 | FakeGame.service = FakeGame.GetService | |
| 147 | FakeService(FakeGame,game) | |
| 148 | --Changing owner to fake player object to support owner:GetMouse() | |
| 149 | game,owner = FakeGame,FakeGame.Players.LocalPlayer | |
| 150 | end | |
| 151 | ||
| 152 | print("Loaded Successfully!")
| |
| 153 | --[[Changeable Variables]]-- | |
| 154 | local multiplier = 1 --Attack multiplier (default is 1) | |
| 155 | local soundlist = {
| |
| 156 | HardHit1 = "rbxassetid://565207203", | |
| 157 | HardHit2 = "rbxassetid://541909913", | |
| 158 | HardHit3 = "rbxassetid://541909983", | |
| 159 | WeakHit1 = "rbxassetid://558642292", | |
| 160 | WeakHit2 = "rbxassetid://541907812", | |
| 161 | Slice1 = "rbxassetid://260429964", | |
| 162 | Slice2 = "rbxassetid://260430015", | |
| 163 | Explosion1 = "rbxassetid://138186576", | |
| 164 | Explosion2 = "rbxassetid://157878578", | |
| 165 | Woosh1 = "rbxassetid://541909867", | |
| 166 | Woosh2 = "rbxassetid://541909763", | |
| 167 | TimeSlow = "rbxassetid://615678808", | |
| 168 | TimeStop = "rbxassetid://274698941", | |
| 169 | TimeResume = "rbxassetid://894793352", | |
| 170 | TimeFast = "rbxassetid://743499393", | |
| 171 | TimeReverse = "rbxassetid://274698941", | |
| 172 | ||
| 173 | } | |
| 174 | ||
| 175 | --[[Important Variables]]-- | |
| 176 | local plr = game:GetService('Players').LocalPlayer
| |
| 177 | local char = plr.Character | |
| 178 | local input = game:GetService('UserInputService')
| |
| 179 | ---- | |
| 180 | local joints = {"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}
| |
| 181 | local torso,head,rootpart = char.Torso,char.Head,char.HumanoidRootPart | |
| 182 | local rs = torso["Right Shoulder"] | |
| 183 | local ls = torso["Left Shoulder"] | |
| 184 | local rh = torso["Right Hip"] | |
| 185 | local lh = torso["Left Hip"] | |
| 186 | local neck = torso.Neck | |
| 187 | local rj = rootpart["RootJoint"] | |
| 188 | ---- | |
| 189 | local huge = Vector3.new(math.huge, math.huge, math.huge) | |
| 190 | local attacking = false | |
| 191 | local cananim = true | |
| 192 | local timestop = false | |
| 193 | local timeslow = false | |
| 194 | local timefast = false | |
| 195 | local reversing = false | |
| 196 | local unfreeze = {}
| |
| 197 | local sounddata = {}
| |
| 198 | local connections = {}
| |
| 199 | local healthstuff = {}
| |
| 200 | ||
| 201 | --[[ Functions ]]-- | |
| 202 | function addattack(keycode, func) | |
| 203 | input.InputBegan:connect(function(inp) | |
| 204 | if inp.KeyCode == keycode and not input:GetFocusedTextBox() then | |
| 205 | func() | |
| 206 | end | |
| 207 | end) | |
| 208 | end | |
| 209 | function attackend(keycode, func) | |
| 210 | input.InputEnded:connect(function(inp) | |
| 211 | if inp.KeyCode == keycode and not input:GetFocusedTextBox() then | |
| 212 | func() | |
| 213 | end | |
| 214 | end) | |
| 215 | end | |
| 216 | function swait(t) | |
| 217 | if t then | |
| 218 | for i = 0, t do | |
| 219 | game:GetService('RunService').Stepped:wait(0)
| |
| 220 | end | |
| 221 | else | |
| 222 | game:GetService('RunService').Stepped:wait(0)
| |
| 223 | end | |
| 224 | return true | |
| 225 | end | |
| 226 | function fade(obj, dest, grow) | |
| 227 | spawn(function() | |
| 228 | local oldcf = obj.CFrame | |
| 229 | for i = 0, 10 do | |
| 230 | if grow then | |
| 231 | obj.Size = obj.Size +Vector3.new(1,1,1) | |
| 232 | obj.CFrame = oldcf | |
| 233 | end | |
| 234 | obj.Transparency = obj.Transparency +0.1 | |
| 235 | swait() | |
| 236 | end | |
| 237 | if dest then | |
| 238 | obj:Destroy() | |
| 239 | end | |
| 240 | end) | |
| 241 | end | |
| 242 | function replacejoint(name) | |
| 243 | local j = torso:FindFirstChild(name) | |
| 244 | if not j then j = char.HumanoidRootPart:FindFirstChild(name) end | |
| 245 | if j then | |
| 246 | if true then | |
| 247 | local already = j.Parent:FindFirstChild(j.Name.." Replacement") | |
| 248 | local new = Instance.new("Weld")
| |
| 249 | local c0 = j.C0 | |
| 250 | local c1 = j.C1 | |
| 251 | new.Part0 = j.Part0 | |
| 252 | j.Part0 = nil | |
| 253 | new.Name = j.Name.." Replacement" | |
| 254 | if already then c0 = already.C0 c1 = already.C1 already:Destroy() end | |
| 255 | new.Parent = j.Parent | |
| 256 | new.Part1 = j.Part1 | |
| 257 | new.C0 = c0 | |
| 258 | new.C1 = c1 | |
| 259 | return new | |
| 260 | end | |
| 261 | end | |
| 262 | end | |
| 263 | function removejoint(name, fast) | |
| 264 | local j = torso:FindFirstChild(name.." Replacement") | |
| 265 | if not j then j = char.HumanoidRootPart:FindFirstChild(name.." Replacement") end | |
| 266 | if j then | |
| 267 | local p0 = j.Part0 | |
| 268 | if p0 ~= nil then | |
| 269 | local c0 = j.C0 | |
| 270 | local c1 = j.C1 | |
| 271 | j:Destroy() | |
| 272 | local new = p0:FindFirstChild(name) | |
| 273 | local ac0 = new.C0 | |
| 274 | local ac1 = new.C1 | |
| 275 | new.Part0 = p0 | |
| 276 | new.C0 = c0 | |
| 277 | new.C1 = c1 | |
| 278 | spawn(function() | |
| 279 | if name ~= "RootJoint" then | |
| 280 | if not fast then | |
| 281 | for i = 0, 0.6, 0.1 do | |
| 282 | new.C0 = new.C0:Lerp(ac0, 0.5) | |
| 283 | new.C1 = new.C1:lerp(ac1, 0.5) | |
| 284 | swait() | |
| 285 | end | |
| 286 | else | |
| 287 | new.C0 = new.C0:Lerp(ac0, 1) | |
| 288 | new.C1 = new.C1:lerp(ac1, 1) | |
| 289 | end | |
| 290 | end | |
| 291 | end) | |
| 292 | end | |
| 293 | end | |
| 294 | end | |
| 295 | function fixalljoints(fast) | |
| 296 | for i,v in pairs({"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}) do
| |
| 297 | removejoint(v, fast) | |
| 298 | end | |
| 299 | end | |
| 300 | function getnewjoints() | |
| 301 | local rs = replacejoint("Right Shoulder")
| |
| 302 | local ls = replacejoint("Left Shoulder")
| |
| 303 | local rh = replacejoint("Right Hip")
| |
| 304 | local lh = replacejoint("Left Hip")
| |
| 305 | local neck = replacejoint("Neck")
| |
| 306 | local rj = replacejoint("RootJoint")
| |
| 307 | return rs,ls,rh,lh,neck,rj | |
| 308 | end | |
| 309 | function knockback(hit, force) | |
| 310 | local bv = Instance.new("BodyVelocity")
| |
| 311 | bv.MaxForce = huge | |
| 312 | bv.Velocity = force | |
| 313 | bv.Parent = hit | |
| 314 | game:GetService('Debris'):AddItem(bv, 0.15)
| |
| 315 | end | |
| 316 | function soundeffect(id, volume, speed, parent, forcewait) | |
| 317 | local func = function() | |
| 318 | local s = LoadLibrary("RbxUtility").Create("Sound")()
| |
| 319 | s.Name = "SoundEffect" | |
| 320 | s.Volume = volume | |
| 321 | s.PlaybackSpeed = speed | |
| 322 | s.SoundId = id | |
| 323 | s.Name = "dont" | |
| 324 | s.Looped = false | |
| 325 | s.Parent = parent | |
| 326 | s:Play() | |
| 327 | repeat wait() until not s.Playing | |
| 328 | s:Destroy() | |
| 329 | end | |
| 330 | if forcewait then | |
| 331 | func() | |
| 332 | else | |
| 333 | spawn(func) | |
| 334 | end | |
| 335 | end | |
| 336 | function getascendants(obj) | |
| 337 | local par = obj | |
| 338 | local ret = {}
| |
| 339 | pcall(function() | |
| 340 | repeat | |
| 341 | par = par.Parent | |
| 342 | if par ~= nil then | |
| 343 | table.insert(ret, par) | |
| 344 | end | |
| 345 | until par == nil | |
| 346 | end) | |
| 347 | return ret | |
| 348 | end | |
| 349 | function findascendant(obj, class) | |
| 350 | local par = obj | |
| 351 | local ret = nil | |
| 352 | pcall(function() | |
| 353 | repeat | |
| 354 | par = par.Parent | |
| 355 | if par:IsA(class) then | |
| 356 | ret = par | |
| 357 | break | |
| 358 | end | |
| 359 | until par == nil | |
| 360 | end) | |
| 361 | return ret | |
| 362 | end | |
| 363 | function hurt(hit, dmg) | |
| 364 | --pcall(function() | |
| 365 | local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
| |
| 366 | if hum then | |
| 367 | if hum.Parent ~= char then | |
| 368 | hum.Health = hum.Health - dmg | |
| 369 | hum.Health = hum.Health - dmg | |
| 370 | soundeffect(soundlist.Headshot, 1.5, 1, workspace.CurrentCamera) | |
| 371 | return true | |
| 372 | end | |
| 373 | end | |
| 374 | --end) | |
| 375 | end | |
| 376 | --[[ Actual script :OOOOOOOOOO ]]-- | |
| 377 | addattack(Enum.KeyCode.G, function() | |
| 378 | if not timeslow and not timefast and not reversing then | |
| 379 | local p = Instance.new("Part")
| |
| 380 | p.Anchored = true | |
| 381 | p.Material = "Glass" | |
| 382 | p.Size = Vector3.new(0.1,0.1,0.1) | |
| 383 | p.BrickColor = BrickColor.new("Toothpaste")
| |
| 384 | p.CanCollide = false | |
| 385 | p.CFrame = char.HumanoidRootPart.CFrame | |
| 386 | local m = Instance.new("SpecialMesh")
| |
| 387 | m.MeshType = "Sphere" | |
| 388 | m.Parent = p | |
| 389 | p.Parent = char | |
| 390 | spawn(function() | |
| 391 | for i = 1, 50 do | |
| 392 | p.Transparency = i/50 | |
| 393 | p.Size = p.Size:Lerp(Vector3.new(40,40,40),0.1) | |
| 394 | p.CFrame = char.HumanoidRootPart.CFrame | |
| 395 | swait() | |
| 396 | end | |
| 397 | p:Destroy() | |
| 398 | end) | |
| 399 | if not timestop then | |
| 400 | local s = Instance.new("Sound")
| |
| 401 | s.Volume = 3 | |
| 402 | s.Name = "dont" | |
| 403 | s.SoundId = soundlist.TimeStop | |
| 404 | s.Parent = char | |
| 405 | s:Play() | |
| 406 | dcon = workspace.DescendantAdded:connect(function(obj) | |
| 407 | pcall(function() | |
| 408 | swait() | |
| 409 | local ok = true | |
| 410 | for i,v in pairs(getascendants(obj)) do | |
| 411 | if v.Name:lower():find("ignoremodel") then
| |
| 412 | ok = false | |
| 413 | end | |
| 414 | end | |
| 415 | if obj:IsA("BasePart") and ok and not findascendant(obj, "Tool") and not findascendant(obj, "HopperBin") and not findascendant(obj, "Camera") then
| |
| 416 | if not obj.Anchored and obj.Name ~= "HumanoidRootPart" then | |
| 417 | table.insert(unfreeze, obj) | |
| 418 | obj.Anchored = true | |
| 419 | end | |
| 420 | end | |
| 421 | if obj:IsA("Sound") and obj.Name ~= "dont" then
| |
| 422 | if obj.Playing then | |
| 423 | obj:Pause() | |
| 424 | table.insert(unfreeze, obj) | |
| 425 | end | |
| 426 | end | |
| 427 | if obj:IsA("Humanoid") then
| |
| 428 | local last = obj.Health | |
| 429 | local always = last | |
| 430 | local con = obj.HealthChanged:connect(function(health) | |
| 431 | if last-health > 0 then | |
| 432 | table.insert(healthstuff, {hum = obj, change = last-health})
| |
| 433 | end | |
| 434 | last = health | |
| 435 | obj.Health = always | |
| 436 | end) | |
| 437 | table.insert(connections, con) | |
| 438 | end | |
| 439 | end) | |
| 440 | end) | |
| 441 | for i,v in pairs(workspace:GetDescendants()) do | |
| 442 | pcall(function() | |
| 443 | if v:IsA("BasePart") then
| |
| 444 | local ok = true | |
| 445 | for i,e in pairs(getascendants(v)) do | |
| 446 | if e.Name:lower():find("ignore_model") then
| |
| 447 | ok = false | |
| 448 | end | |
| 449 | if e:IsA("Camera") then
| |
| 450 | ok = false | |
| 451 | end | |
| 452 | end | |
| 453 | if not v.Anchored and ok and v.Parent ~= char and not findascendant(v, "Camera") and not findascendant(v, "Tool") and not findascendant(v, "HopperBin") then | |
| 454 | local ok = true | |
| 455 | if v.Parent:IsA("Accessory") then ok = false end
| |
| 456 | if ok and v.Name ~= "HumanoidRootPart" then | |
| 457 | v.Anchored = true | |
| 458 | table.insert(unfreeze, v) | |
| 459 | end | |
| 460 | end | |
| 461 | end | |
| 462 | end) | |
| 463 | pcall(function() | |
| 464 | if v:IsA("Sound") and v.Name ~= "dont" then
| |
| 465 | if v.Playing then | |
| 466 | v:Pause() | |
| 467 | table.insert(unfreeze, v) | |
| 468 | end | |
| 469 | end | |
| 470 | end) | |
| 471 | pcall(function() | |
| 472 | if v:IsA("Humanoid") then
| |
| 473 | local last = v.Health | |
| 474 | local always = last | |
| 475 | local con = v.HealthChanged:connect(function(health) | |
| 476 | if last-health > 0 then | |
| 477 | table.insert(healthstuff, {hum = v, change = last-health})
| |
| 478 | end | |
| 479 | last = health | |
| 480 | v.Health = always | |
| 481 | end) | |
| 482 | table.insert(connections, con) | |
| 483 | end | |
| 484 | end) | |
| 485 | end | |
| 486 | timestop = true | |
| 487 | local cor = Instance.new("ColorCorrectionEffect")
| |
| 488 | cor.Name = "tstopef" | |
| 489 | cor.Parent = game:GetService('Lighting')
| |
| 490 | for i = 1, 50 do | |
| 491 | cor.Saturation = Vector3.new(cor.Saturation,0,0):Lerp(Vector3.new(-5,0,0), 0.05).X | |
| 492 | swait() | |
| 493 | end | |
| 494 | game.Debris:AddItem(s, 2) | |
| 495 | else | |
| 496 | local s = Instance.new("Sound")
| |
| 497 | s.Volume = 7 | |
| 498 | s.Name = "dont" | |
| 499 | s.SoundId = soundlist.TimeResume | |
| 500 | s.Parent = char | |
| 501 | s:Play() | |
| 502 | local cor = game:GetService('Lighting'):FindFirstChild("tstopef")
| |
| 503 | if cor then | |
| 504 | for i = 1, 50 do | |
| 505 | cor.Saturation = Vector3.new(cor.Saturation,0,0):Lerp(Vector3.new(0,0,0), 0.05).X | |
| 506 | swait() | |
| 507 | end | |
| 508 | cor:Destroy() | |
| 509 | end | |
| 510 | game.Debris:AddItem(s, 2) | |
| 511 | timestop = false | |
| 512 | for i,v in pairs(unfreeze) do | |
| 513 | pcall(function() | |
| 514 | v.Anchored = false | |
| 515 | end) | |
| 516 | pcall(function() | |
| 517 | v:Resume() | |
| 518 | end) | |
| 519 | end | |
| 520 | for i,v in pairs(connections) do | |
| 521 | pcall(function() | |
| 522 | v:disconnect() | |
| 523 | end) | |
| 524 | end | |
| 525 | for i,v in pairs(healthstuff) do | |
| 526 | pcall(function() | |
| 527 | local hum = v.hum | |
| 528 | hum.Health = hum.Health - v.change | |
| 529 | if hum.Parent:FindFirstChild("Health") then
| |
| 530 | pcall(function() | |
| 531 | hum.Parent.Health.Disabled = false | |
| 532 | end) | |
| 533 | end | |
| 534 | end) | |
| 535 | end | |
| 536 | pcall(function() | |
| 537 | dcon:disconnect() | |
| 538 | end) | |
| 539 | healthstuff = {}
| |
| 540 | unfreeze = {}
| |
| 541 | end | |
| 542 | end | |
| 543 | end) | |
| 544 | local humanoiddata = {}
| |
| 545 | local bodymoverdata = {}
| |
| 546 | local dcon2 | |
| 547 | local connectionsdata = {}
| |
| 548 | addattack(Enum.KeyCode.H, function() | |
| 549 | if not timeslow and not timestop and not reversing then | |
| 550 | local p = Instance.new("Part")
| |
| 551 | p.Anchored = true | |
| 552 | p.Material = "Glass" | |
| 553 | p.Size = Vector3.new(0.1,0.1,0.1) | |
| 554 | p.BrickColor = BrickColor.new("Toothpaste")
| |
| 555 | p.CanCollide = false | |
| 556 | p.CFrame = char.HumanoidRootPart.CFrame | |
| 557 | local m = Instance.new("SpecialMesh")
| |
| 558 | m.MeshType = "Sphere" | |
| 559 | m.Parent = p | |
| 560 | p.Parent = char | |
| 561 | spawn(function() | |
| 562 | for i = 1, 50 do | |
| 563 | p.Transparency = i/50 | |
| 564 | p.Size = p.Size:Lerp(Vector3.new(40,40,40),0.1) | |
| 565 | p.CFrame = char.HumanoidRootPart.CFrame | |
| 566 | swait() | |
| 567 | end | |
| 568 | p:Destroy() | |
| 569 | end) | |
| 570 | if not timefast then | |
| 571 | timefast = true | |
| 572 | soundeffect(soundlist.TimeFast, 1.5, 1, char) | |
| 573 | for i,v in pairs(workspace:GetDescendants()) do | |
| 574 | if v:IsA("Humanoid") then
| |
| 575 | table.insert(humanoiddata, {Hum = v, WS = v.WalkSpeed, JP = v.JumpPower})
| |
| 576 | for _,track in pairs(v:GetPlayingAnimationTracks()) do | |
| 577 | end | |
| 578 | local con = v.AnimationPlayed:connect(function(track) | |
| 579 | end) | |
| 580 | table.insert(connections, con) | |
| 581 | end | |
| 582 | if v:IsA("BodyVelocity") then
| |
| 583 | table.insert(bodymoverdata, {Mover = v, Vel = v.Velocity})
| |
| 584 | end | |
| 585 | if v:IsA("BodyPosition") then
| |
| 586 | table.insert(bodymoverdata, {Mover = v, Vel = v.P})
| |
| 587 | end | |
| 588 | if v.Name == "HumanoidRootPart" and v:IsA("BasePart") then
| |
| 589 | end | |
| 590 | if v:IsA("Sound") and v.Name ~= "dont" then
| |
| 591 | table.insert(sounddata, {Sound = v, Speed = v.PlaybackSpeed})
| |
| 592 | end | |
| 593 | end | |
| 594 | dcon2 = workspace.DescendantAdded:connect(function(v) | |
| 595 | swait(2) | |
| 596 | if v:IsA("Humanoid") then
| |
| 597 | table.insert(humanoiddata, {Hum = v, WS = v.WalkSpeed, JP = v.JumpPower})
| |
| 598 | for _,track in pairs(v:GetPlayingAnimationTracks()) do | |
| 599 | track:AdjustSpeed(1.4) | |
| 600 | end | |
| 601 | local con = v.AnimationPlayed:connect(function(track) | |
| 602 | track:AdjustSpeed(1.4) | |
| 603 | end) | |
| 604 | table.insert(connections, con) | |
| 605 | end | |
| 606 | if v:IsA("BodyVelocity") then
| |
| 607 | table.insert(bodymoverdata, {Mover = v, Vel = v.Velocity})
| |
| 608 | end | |
| 609 | if v:IsA("BodyPosition") then
| |
| 610 | table.insert(bodymoverdata, {Mover = v, Vel = v.P})
| |
| 611 | end | |
| 612 | if v.Name == "HumanoidRootPart" and v:IsA("BasePart") then
| |
| 613 | end | |
| 614 | if v:IsA("Sound") and v.Name ~= "dont" then
| |
| 615 | table.insert(sounddata, {Sound = v, Speed = v.PlaybackSpeed})
| |
| 616 | end | |
| 617 | end) | |
| 618 | else | |
| 619 | timefast = false | |
| 620 | soundeffect(soundlist.TimeResume, 1.5, 1, char) | |
| 621 | for i,v in pairs(humanoiddata) do | |
| 622 | pcall(function() | |
| 623 | v["Hum"].WalkSpeed = v["WS"] | |
| 624 | v["Hum"].JumpPower = v["JP"] | |
| 625 | end) | |
| 626 | end | |
| 627 | for i,v in pairs(bodymoverdata) do | |
| 628 | pcall(function() | |
| 629 | if v["Mover"]:IsA("BodyVelocity") then
| |
| 630 | v["Mover"].Velocity = v["Vel"] | |
| 631 | end | |
| 632 | if v["Mover"]:IsA("BodyPosition") then
| |
| 633 | v["Mover"].P = v["Vel"] | |
| 634 | end | |
| 635 | end) | |
| 636 | end | |
| 637 | for i,v in pairs(sounddata) do | |
| 638 | pcall(function() | |
| 639 | v["Sound"].PlaybackSpeed = v["Speed"] | |
| 640 | end) | |
| 641 | end | |
| 642 | for i,v in pairs(connections) do | |
| 643 | pcall(function() | |
| 644 | v:disconnect() | |
| 645 | end) | |
| 646 | end | |
| 647 | connections = {}
| |
| 648 | pcall(function() | |
| 649 | dcon2:disconnect() | |
| 650 | end) | |
| 651 | humanoiddata = {}
| |
| 652 | end | |
| 653 | end | |
| 654 | end) | |
| 655 | local reversedata = {}
| |
| 656 | local saved = false | |
| 657 | addattack(Enum.KeyCode.C, function() | |
| 658 | if not timestop and not timeslow and not timefast then | |
| 659 | if not saved then | |
| 660 | saved = true | |
| 661 | for i,v in pairs(workspace:GetDescendants()) do | |
| 662 | end | |
| 663 | else | |
| 664 | reversing = true | |
| 665 | saved = false | |
| 666 | soundeffect(soundlist.TimeReverse, 2, 1, workspace) | |
| 667 | for i = 1, 10 do | |
| 668 | for _,v in pairs(reversedata) do | |
| 669 | local obj = v.obj | |
| 670 | local cf = v.cf obj.Anchored = true | |
| 671 | end | |
| 672 | end | |
| 673 | swait() | |
| 674 | end | |
| 675 | char.HumanoidRootPart.Velocity = Vector3.new(0,0,0) | |
| 676 | reversedata = {}
| |
| 677 | reversing = false | |
| 678 | end | |
| 679 | end) |