Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- repeat wait() until game:service'Players'.LocalPlayer.Character
- --[[
- - Added new color scheme.
- - Some minor edits.
- - New engine type, for your faster speed requirements.
- - Camera bug fix.
- ]]--
- do --CFrame lerp
- local function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
- local trace = m00 + m11 + m22
- if trace > 0 then
- local s = math.sqrt(1 + trace)
- local recip = 0.5/s
- return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
- else
- local i = 0
- if m11 > m00 then
- i = 1
- end
- if m22 > (i == 0 and m00 or m11) then
- i = 2
- end
- if i == 0 then
- local s = math.sqrt(m00-m11-m22+1)
- local recip = 0.5/s
- return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
- elseif i == 1 then
- local s = math.sqrt(m11-m22-m00+1)
- local recip = 0.5/s
- return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
- elseif i == 2 then
- local s = math.sqrt(m22-m00-m11+1)
- local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
- end
- end
- end
- local function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z
- local wx, wy, wz = w*xs, w*ys, w*zs
- local xx = x*xs
- local xy = x*ys
- local xz = x*zs
- local yy = y*ys
- local yz = y*zs
- local zz = z*zs
- 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))
- end
- local function QuaternionSlerp(a, b, t)
- local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
- local startInterp, finishInterp;
- if cosTheta >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = math.acos(cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((1-t)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = 1-t
- finishInterp = t
- end
- else
- if (1+cosTheta) > 0.0001 then
- local theta = math.acos(-cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((t-1)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = t-1
- finishInterp = t
- end
- end
- 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
- end
- function clerp(a,b,t)
- local qa = {QuaternionFromCFrame(a)}
- local qb = {QuaternionFromCFrame(b)}
- local ax, ay, az = a.x, a.y, a.z
- local bx, by, bz = b.x, b.y, b.z
- local _t = 1-t
- return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
- end
- end
- plr = game:service'Players'.LocalPlayer
- char = plr.Character
- mouse = plr:GetMouse()
- humanoid = char:findFirstChild("Humanoid")
- torso = char:findFirstChild("Torso")
- head = char.Head
- ra = char:findFirstChild("Right Arm")
- la = char:findFirstChild("Left Arm")
- rl = char:findFirstChild("Right Leg")
- ll = char:findFirstChild("Left Leg")
- rs = torso:findFirstChild("Right Shoulder")
- ls = torso:findFirstChild("Left Shoulder")
- rh = torso:findFirstChild("Right Hip")
- lh = torso:findFirstChild("Left Hip")
- neck = torso:findFirstChild("Neck")
- rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
- anim = char:findFirstChild("Animate")
- rootpart = char:findFirstChild("HumanoidRootPart")
- camera = workspace.CurrentCamera
- modelforparts = char:findFirstChild("ModelForParts") or Instance.new("Model", char)
- modelforparts.Name = "ModelForParts"
- equipped = false
- local MAXSPEED = 90
- local SPEED = 0
- bg = Instance.new("BodyGyro")
- bg.maxTorque = Vector3.new(9e6,9e6,9e6)
- bg.D = 800
- bv = Instance.new("BodyVelocity")
- bv.maxForce = Vector3.new(9e6,9e6,9e6)
- local sound = Instance.new("Sound", head)
- sound.Volume = 1
- sound.Pitch = 2
- sound.SoundId = "http://www.roblox.com/asset/?id=142782429"
- sound.Looped = true
- wait()
- sound:play()
- ColorScheme1 = BrickColor.new(106)
- ColorScheme2 = BrickColor.new(40)
- ColorScheme3 = BrickColor.new(199)
- ANGLE = 0
- equipped = true
- rs.Parent = nil
- ls.Parent = nil
- rh.Parent = nil
- lh.Parent = nil
- anim.Parent = nil
- wait()
- local rm = Instance.new("Weld", modelforparts)
- rm.C0 = CFrame.new(1.5, 0.5, 0)
- rm.C1 = CFrame.new(0, 0.5, 0)
- rm.Part0 = torso
- rm.Part1 = ra
- local lm = Instance.new("Weld", modelforparts)
- lm.C0 = CFrame.new(-1.5, 0.5, 0)
- lm.C1 = CFrame.new(0, 0.5, 0)
- lm.Part0 = torso
- lm.Part1 = la
- local rlegm = Instance.new("Weld", modelforparts)
- rlegm.C0 = CFrame.new(0.5, -1, 0)
- rlegm.C1 = CFrame.new(0, 1, 0)
- rlegm.Part0 = torso
- rlegm.Part1 = rl
- local llegm = Instance.new("Weld", modelforparts)
- llegm.C0 = CFrame.new(-0.5, -1, 0)
- llegm.C1 = CFrame.new(0, 1, 0)
- llegm.Part0 = torso
- llegm.Part1 = ll
- --grey part
- local part = Instance.new("Part", modelforparts)
- part.Size = Vector3.new(2.2, .85, 2.2)
- part.FormFactor = 'Custom'
- part.BrickColor = ColorScheme3
- part.Locked = true
- part.TopSurface = 10
- part.BottomSurface = 10
- part.LeftSurface = 10
- part.RightSurface = 10
- part.FrontSurface = 10
- part.BackSurface = 10
- part:breakJoints()
- part.Material = "SmoothPlastic"
- part.CanCollide = false
- Instance.new("CylinderMesh", part)
- local weld = Instance.new("Weld", part)
- weld.Part0 = part
- weld.Part1 = torso
- weld.C1 = CFrame.new(0, -2.1, 0)
- weld.C0 = CFrame.Angles(math.pi/2, math.pi/2, 0) * CFrame.new(0, 0, .95)
- --orange part
- local part2 = part:clone()
- part2.Parent = modelforparts
- part2.Size = Vector3.new(2.5, 1.05, 2.5)
- part2.BrickColor = ColorScheme1
- local wld2 = Instance.new("Weld", part)
- wld2.Part0 = part2
- wld2.Part1 = part
- wld2.C1 = CFrame.new()
- wld2.C0 = CFrame.new()
- --white part
- local part3 = part:clone()
- part3.Parent = modelforparts
- part3.Size = Vector3.new(2.62, .5, 2.62)
- part3.BrickColor = ColorScheme2
- local wld3 = Instance.new("Weld", part)
- wld3.Part0 = part3
- wld3.Part1 = part
- wld3.C1 = CFrame.new()
- wld3.C0 = CFrame.new()
- --airblower
- local airblowercyl = part:clone()
- airblowercyl.Parent = modelforparts
- airblowercyl.Size = Vector3.new(.95, 3.5, .95)
- airblowercyl.BrickColor = ColorScheme3
- local smoke = Instance.new("Smoke", airblowercyl)
- smoke.Color = Color3.new(.3, .3, .3)
- smoke.RiseVelocity = 10
- smoke.Opacity = .1
- local cwld = Instance.new("Weld", airblowercyl)
- cwld.Part0 = airblowercyl
- cwld.Part1 = part
- cwld.C1 = CFrame.Angles(0, 0, -math.pi/2)
- cwld.C0 = CFrame.new(0, -1.85-0.925, -.6) * CFrame.Angles(math.pi/14, 0, 0)
- --handles
- local hndl = part:clone()
- hndl.Parent = modelforparts
- hndl.Size = Vector3.new(.2, .4, .2)
- hndl.BrickColor = BrickColor.new(26)
- hndl.Mesh:Destroy()
- local hwld = Instance.new("Weld", hndl)
- hwld.Part1 = part
- hwld.Part0 = hndl
- hwld.C1 = CFrame.new(.1, 0, 0) * CFrame.Angles(math.pi/2, 0, 0)
- hwld.C0 = CFrame.new(0, -.82 - .4, 0)
- Instance.new("BlockMesh", hndl).Scale = Vector3.new(.5, 1, .5)
- local hndl2 = hndl:clone()
- hndl2.Parent = modelforparts
- hndl2.Size = Vector3.new(.8, .2, .2)
- local hwld2 = Instance.new("Weld", hndl2)
- hwld2.Part0 = hndl2
- hwld2.Part1 = part
- hwld2.C1 = CFrame.new(-.25, 0, 0) * CFrame.Angles(math.pi/2, 0, 0)
- hwld2.C0 = CFrame.new(0, -1 - .4, 0)
- hndl2.Mesh.Scale = Vector3.new(1, .5, .5)
- local hndl3 = hndl:clone()
- hndl3.Parent = modelforparts
- hndl3.Size = Vector3.new(.2, .4, .2)
- local hwld3 = Instance.new("Weld", hndl3)
- hwld3.Part0 = hndl3
- hwld3.Part1 = part
- hwld3.C1 = CFrame.new(-.6, 0, 0) * CFrame.Angles(math.pi/2, 0, 0)
- hwld3.C0 = CFrame.new(0, -.82 - .4, 0)
- --balloon ropes
- local blnrope = part:clone()
- blnrope.Parent = modelforparts
- blnrope.Size = Vector3.new(.2, 3.8, .2)
- blnrope.BrickColor = BrickColor.new(1)
- blnrope.Mesh:Destroy()
- local blnwld = Instance.new("Weld", blnrope)
- blnwld.Part0 = blnrope
- blnwld.Part1 = airblowercyl
- blnwld.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2, math.pi/7, -math.pi/8)
- blnwld.C0 = CFrame.new(0, -2, 0)
- Instance.new("BlockMesh", blnrope).Scale = Vector3.new(.2, 1, .2)
- local blnrope2 = blnrope:clone()
- blnrope2.Parent = modelforparts
- blnrope2.Size = Vector3.new(.2, 4, .2)
- local blnwld2 = Instance.new("Weld", blnrope2)
- blnwld2.Part0 = blnrope2
- blnwld2.Part1 = airblowercyl
- blnwld2.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2, math.pi/4, -math.pi/74)
- blnwld2.C0 = CFrame.new(0, -2.2, 0)
- local blnrope3 = blnrope:clone()
- blnrope3.Parent = modelforparts
- local blnwld3 = Instance.new("Weld", blnrope3)
- blnwld3.Part0 = blnrope3
- blnwld3.Part1 = airblowercyl
- blnwld3.C0 = CFrame.new(0, -2, 0)
- --Stored balloon rope welds
- blnwldC1 = blnwld.C1
- blnwld2C1 = blnwld2.C1
- blnwld3C1 = blnwld3.C1
- --balloons
- local bln = part:clone()
- bln.Parent = modelforparts
- bln.Size = Vector3.new(1.65, 1.8, 1.65)
- bln.BrickColor = BrickColor.new(119)
- bln.Mesh:Destroy()
- bln.Transparency = .1
- local balnwld = Instance.new("Weld", bln)
- balnwld.Part0 = bln
- balnwld.Part1 = blnrope
- balnwld.C1 = CFrame.new(0, 0, 0)
- balnwld.C0 = CFrame.new(0, -2.6, 0)
- Instance.new("SpecialMesh", bln).MeshType = "Sphere"
- local bln2 = bln:clone()
- bln2.Parent = modelforparts
- bln2.BrickColor = BrickColor.new(23)
- local balnwld2 = Instance.new("Weld", bln2)
- balnwld2.Part0 = bln2
- balnwld2.Part1 = blnrope2
- balnwld2.C1 = CFrame.new(0, 0, 0)
- balnwld2.C0 = CFrame.new(0, -2.8, 0)
- local bln3 = bln:clone()
- bln3.Parent = modelforparts
- bln3.BrickColor = BrickColor.new(21)
- local balnwld3 = Instance.new("Weld", bln3)
- balnwld3.Part0 = bln3
- balnwld3.Part1 = blnrope3
- balnwld3.C0 = CFrame.new(0, -2.6, 0)
- --Controls
- bg.Parent = rootpart
- bv.Parent = rootpart
- forwards = false
- backwards = false
- mouse.KeyDown:connect(function(k)
- if k == "w" then
- forwards = true
- coroutine.wrap(function()
- while forwards do wait()
- if SPEED >= MAXSPEED then SPEED = MAXSPEED forwards = false break end
- sound.Volume = sound.Volume + .05
- if sound.Volume >= .5 then sound.Volume = .5 end
- SPEED = SPEED + 5
- end
- end)()
- end
- end)
- mouse.KeyUp:connect(function(k)
- if k == "w" then
- forwards = false
- coroutine.wrap(function()
- while SPEED >= 0 do wait()
- sound.Volume = sound.Volume - .05
- if sound.Volume <= 0.25 then sound.Volume = 0.25 end
- SPEED = SPEED - 5
- if forward then break end
- if SPEED <= 0 then SPEED = 0 break end
- end
- end)()
- end
- end)
- --BALLONS MOOOOVEEE :DDD
- game:service'RunService'.RenderStepped:connect(function()
- if not equipped then return end
- blnwldC1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2 - math.rad(SPEED/1.7) + math.sin(ANGLE)*.025, math.pi/7 + math.sin(ANGLE)*.105, -math.pi/8 - math.sin(ANGLE)*.018)
- blnwld2C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2 - math.rad(SPEED/1.7) + math.sin(ANGLE)*.015, math.pi/4 - math.sin(ANGLE)*.065, -math.pi/74 + math.sin(ANGLE)*.021)
- blnwld3C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2 - math.rad(SPEED/1.7) - math.sin(ANGLE)*.02, math.pi/16 - math.sin(ANGLE)*.125, math.pi/9 - math.sin(ANGLE)*.078)
- blnwld.C1 = clerp(blnwld.C1, blnwldC1, 0.05)
- blnwld2.C1 = clerp(blnwld2.C1, blnwld2C1, 0.05)
- blnwld3.C1 = clerp(blnwld3.C1, blnwld3C1, 0.05)
- end)
- --positioning welds
- lm.C0 = CFrame.new(-1.25, .05, -.5) * CFrame.Angles(math.rad(35), 0, math.rad(45))
- rm.C0 = CFrame.new(1.25, .05, -.5) * CFrame.Angles(math.rad(35), 0, -math.rad(45))
- llegm.C0 = CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0, -math.rad(15))
- rlegm.C0 = CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0, math.rad(15))
- game:service'RunService'.RenderStepped:connect(function()
- for i,v in pairs(torso:children()) do if v and v:IsA'BodyGyro' then v:Destroy() end end
- ANGLE = (ANGLE % 360) + math.random(1, 10)/100
- humanoid.PlatformStand = true
- local rotpos = Vector3.new(camera.CoordinateFrame.x, camera.CoordinateFrame.y, camera.CoordinateFrame.z)
- bg.cframe = CFrame.new(torso.Position,rotpos) * CFrame.Angles(0, math.pi, 0)
- bv.velocity = (torso.CFrame * CFrame.Angles(math.pi/14, 0, 0)).lookVector * SPEED
- end)
- --[[ Time Testing ]]--
- -------------------------------------------------------
- --[[
- This script was created by WafflesAreVeryGood.
- ATTACKS
- _______
- --]]
- -------------------------------------------------------
- print("This script was created by WafflesAreVeryGood!")
- --[[Changeable Variables]]--
- local multiplier = 1 --Attack multiplier (default is 1)
- local soundlist = {
- HardHit1 = "rbxassetid://565207203",
- HardHit2 = "rbxassetid://541909913",
- HardHit3 = "rbxassetid://541909983",
- WeakHit1 = "rbxassetid://558642292",
- WeakHit2 = "rbxassetid://541907812",
- Slice1 = "rbxassetid://260429964",
- Slice2 = "rbxassetid://260430015",
- Explosion1 = "rbxassetid://138186576",
- Explosion2 = "rbxassetid://157878578",
- Woosh1 = "rbxassetid://541909867",
- Woosh2 = "rbxassetid://541909763",
- TimeSlow = "rbxassetid://615678808",
- TimeStop = "rbxassetid://926382097",
- TimeResume = "rbxassetid://894793352",
- TimeFast = "rbxassetid://743499393",
- TimeReverse = "rbxassetid://618737332",
- }
- --[[Important Variables]]--
- local plr = game:GetService('Players').LocalPlayer
- local char = plr.Character
- local mouse = plr:GetMouse()
- local input = game:GetService('UserInputService')
- ----
- local joints = {"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}
- local torso,head,rootpart = char.Torso,char.Head,char.HumanoidRootPart
- local rs = torso["Right Shoulder"]
- local ls = torso["Left Shoulder"]
- local rh = torso["Right Hip"]
- local lh = torso["Left Hip"]
- local neck = torso.Neck
- local rj = rootpart["RootJoint"]
- ----
- local huge = Vector3.new(math.huge, math.huge, math.huge)
- local attacking = false
- local cananim = true
- local timestop = false
- local timeslow = false
- local timefast = false
- local reversing = false
- local unfreeze = {}
- local sounddata = {}
- local connections = {}
- local healthstuff = {}
- --[[ Functions ]]--
- function addattack(keycode, func)
- input.InputBegan:connect(function(inp)
- if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
- func()
- end
- end)
- end
- function attackend(keycode, func)
- input.InputEnded:connect(function(inp)
- if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
- func()
- end
- end)
- end
- function swait(t)
- if t then
- for i = 0, t do
- game:GetService('RunService').Stepped:wait(0)
- end
- else
- game:GetService('RunService').Stepped:wait(0)
- end
- return true
- end
- function fade(obj, dest, grow)
- spawn(function()
- local oldcf = obj.CFrame
- for i = 0, 10 do
- if grow then
- obj.Size = obj.Size +Vector3.new(1,1,1)
- obj.CFrame = oldcf
- end
- obj.Transparency = obj.Transparency +0.1
- swait()
- end
- if dest then
- obj:Destroy()
- end
- end)
- end
- function replacejoint(name)
- local j = torso:FindFirstChild(name)
- if not j then j = char.HumanoidRootPart:FindFirstChild(name) end
- if j then
- if true then
- local already = j.Parent:FindFirstChild(j.Name.." Replacement")
- local new = Instance.new("Weld")
- local c0 = j.C0
- local c1 = j.C1
- new.Part0 = j.Part0
- j.Part0 = nil
- new.Name = j.Name.." Replacement"
- if already then c0 = already.C0 c1 = already.C1 already:Destroy() end
- new.Parent = j.Parent
- new.Part1 = j.Part1
- new.C0 = c0
- new.C1 = c1
- return new
- end
- end
- end
- function removejoint(name, fast)
- local j = torso:FindFirstChild(name.." Replacement")
- if not j then j = char.HumanoidRootPart:FindFirstChild(name.." Replacement") end
- if j then
- local p0 = j.Part0
- if p0 ~= nil then
- local c0 = j.C0
- local c1 = j.C1
- j:Destroy()
- local new = p0:FindFirstChild(name)
- local ac0 = new.C0
- local ac1 = new.C1
- new.Part0 = p0
- new.C0 = c0
- new.C1 = c1
- spawn(function()
- if name ~= "RootJoint" then
- if not fast then
- for i = 0, 0.6, 0.1 do
- new.C0 = new.C0:Lerp(ac0, 0.5)
- new.C1 = new.C1:lerp(ac1, 0.5)
- swait()
- end
- else
- new.C0 = new.C0:Lerp(ac0, 1)
- new.C1 = new.C1:lerp(ac1, 1)
- end
- end
- end)
- end
- end
- end
- function fixalljoints(fast)
- for i,v in pairs({"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}) do
- removejoint(v, fast)
- end
- end
- function getnewjoints()
- local rs = replacejoint("Right Shoulder")
- local ls = replacejoint("Left Shoulder")
- local rh = replacejoint("Right Hip")
- local lh = replacejoint("Left Hip")
- local neck = replacejoint("Neck")
- local rj = replacejoint("RootJoint")
- return rs,ls,rh,lh,neck,rj
- end
- function knockback(hit, force)
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = huge
- bv.Velocity = force
- bv.Parent = hit
- game:GetService('Debris'):AddItem(bv, 0.15)
- end
- function soundeffect(id, volume, speed, parent, forcewait)
- local func = function()
- local s = LoadLibrary("RbxUtility").Create("Sound")()
- s.Name = "SoundEffect"
- s.Volume = volume
- s.PlaybackSpeed = speed
- s.SoundId = id
- s.Name = "dont"
- s.Looped = false
- s.Parent = parent
- s:Play()
- repeat wait() until not s.Playing
- s:Destroy()
- end
- if forcewait then
- func()
- else
- spawn(func)
- end
- end
- function getascendants(obj)
- local par = obj
- local ret = {}
- pcall(function()
- repeat
- par = par.Parent
- if par ~= nil then
- table.insert(ret, par)
- end
- until par == nil
- end)
- return ret
- end
- function findascendant(obj, class)
- local par = obj
- local ret = nil
- pcall(function()
- repeat
- par = par.Parent
- if par:IsA(class) then
- ret = par
- break
- end
- until par == nil
- end)
- return ret
- end
- function hurt(hit, dmg)
- --pcall(function()
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- if hum.Parent ~= char then
- hum.Health = hum.Health - dmg
- hum.Health = hum.Health - dmg
- soundeffect(soundlist.Headshot, 1.5, 1, workspace.CurrentCamera)
- return true
- end
- end
- --end)
- end
- --[[ Actual script :OOOOOOOOOO ]]--
- addattack(Enum.KeyCode.G, function()
- if not timeslow and not timefast and not reversing then
- local p = Instance.new("Part")
- p.Anchored = true
- p.Material = "Glass"
- p.Size = Vector3.new(0.1,0.1,0.1)
- p.BrickColor = BrickColor.new("Toothpaste")
- p.CanCollide = false
- p.CFrame = char.HumanoidRootPart.CFrame
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Sphere"
- m.Parent = p
- p.Parent = char
- spawn(function()
- for i = 1, 50 do
- p.Transparency = i/50
- p.Size = p.Size:Lerp(Vector3.new(40,40,40),0.1)
- p.CFrame = char.HumanoidRootPart.CFrame
- swait()
- end
- p:Destroy()
- end)
- if not timestop then
- local s = Instance.new("Sound")
- s.Volume = 3
- s.Name = "dont"
- s.SoundId = soundlist.TimeStop
- s.Parent = char
- s:Play()
- dcon = workspace.DescendantAdded:connect(function(obj)
- pcall(function()
- swait()
- local ok = true
- for i,v in pairs(getascendants(obj)) do
- if v.Name:lower():find("ignoremodel") then
- ok = false
- end
- end
- if obj:IsA("BasePart") and ok and not findascendant(obj, "Tool") and not findascendant(obj, "HopperBin") and not findascendant(obj, "Camera") then
- if not obj.Anchored and obj.Name ~= "HumanoidRootPart" then
- table.insert(unfreeze, obj)
- obj.Anchored = true
- end
- end
- if obj:IsA("Sound") and obj.Name ~= "dont" then
- if obj.Playing then
- obj:Pause()
- table.insert(unfreeze, obj)
- end
- end
- if obj:IsA("Humanoid") then
- local last = obj.Health
- local always = last
- local con = obj.HealthChanged:connect(function(health)
- if last-health > 0 then
- table.insert(healthstuff, {hum = obj, change = last-health})
- end
- last = health
- obj.Health = always
- end)
- table.insert(connections, con)
- end
- end)
- end)
- for i,v in pairs(workspace:GetDescendants()) do
- pcall(function()
- if v:IsA("BasePart") then
- local ok = true
- for i,e in pairs(getascendants(v)) do
- if e.Name:lower():find("ignore_model") then
- ok = false
- end
- if e:IsA("Camera") then
- ok = false
- end
- end
- 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
- local ok = true
- if v.Parent:IsA("Accessory") then ok = false end
- if ok and v.Name ~= "HumanoidRootPart" then
- v.Anchored = true
- table.insert(unfreeze, v)
- end
- end
- end
- end)
- pcall(function()
- if v:IsA("Sound") and v.Name ~= "dont" then
- if v.Playing then
- v:Pause()
- table.insert(unfreeze, v)
- end
- end
- end)
- pcall(function()
- if v:IsA("Humanoid") then
- local last = v.Health
- local always = last
- local con = v.HealthChanged:connect(function(health)
- if last-health > 0 then
- table.insert(healthstuff, {hum = v, change = last-health})
- end
- last = health
- v.Health = always
- end)
- table.insert(connections, con)
- end
- end)
- end
- timestop = true
- local cor = Instance.new("ColorCorrectionEffect")
- cor.Name = "tstopef"
- cor.Parent = game:GetService('Lighting')
- for i = 1, 50 do
- cor.Saturation = Vector3.new(cor.Saturation,0,0):Lerp(Vector3.new(-5,0,0), 0.05).X
- swait()
- end
- game.Debris:AddItem(s, 2)
- else
- local s = Instance.new("Sound")
- s.Volume = 7
- s.Name = "dont"
- s.SoundId = soundlist.TimeResume
- s.Parent = char
- s:Play()
- local cor = game:GetService('Lighting'):FindFirstChild("tstopef")
- if cor then
- for i = 1, 50 do
- cor.Saturation = Vector3.new(cor.Saturation,0,0):Lerp(Vector3.new(0,0,0), 0.05).X
- swait()
- end
- cor:Destroy()
- end
- game.Debris:AddItem(s, 2)
- timestop = false
- for i,v in pairs(unfreeze) do
- pcall(function()
- v.Anchored = false
- end)
- pcall(function()
- v:Resume()
- end)
- end
- for i,v in pairs(connections) do
- pcall(function()
- v:disconnect()
- end)
- end
- for i,v in pairs(healthstuff) do
- pcall(function()
- local hum = v.hum
- hum.Health = hum.Health - v.change
- if hum.Parent:FindFirstChild("Health") then
- pcall(function()
- hum.Parent.Health.Disabled = false
- end)
- end
- end)
- end
- pcall(function()
- dcon:disconnect()
- end)
- healthstuff = {}
- unfreeze = {}
- end
- end
- end)
- local humanoiddata = {}
- local bodymoverdata = {}
- local dcon2
- local connectionsdata = {}
- addattack(Enum.KeyCode.H, function()
- if not timeslow and not timestop and not reversing then
- local p = Instance.new("Part")
- p.Anchored = true
- p.Material = "Glass"
- p.Size = Vector3.new(0.1,0.1,0.1)
- p.BrickColor = BrickColor.new("Toothpaste")
- p.CanCollide = false
- p.CFrame = char.HumanoidRootPart.CFrame
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Sphere"
- m.Parent = p
- p.Parent = char
- spawn(function()
- for i = 1, 50 do
- p.Transparency = i/50
- p.Size = p.Size:Lerp(Vector3.new(40,40,40),0.1)
- p.CFrame = char.HumanoidRootPart.CFrame
- swait()
- end
- p:Destroy()
- end)
- if not timefast then
- timefast = true
- soundeffect(soundlist.TimeFast, 1.5, 1, char)
- for i,v in pairs(workspace:GetDescendants()) do
- if v:IsA("Humanoid") then
- table.insert(humanoiddata, {Hum = v, WS = v.WalkSpeed, JP = v.JumpPower})
- for _,track in pairs(v:GetPlayingAnimationTracks()) do
- end
- local con = v.AnimationPlayed:connect(function(track)
- end)
- table.insert(connections, con)
- end
- if v:IsA("BodyVelocity") then
- table.insert(bodymoverdata, {Mover = v, Vel = v.Velocity})
- end
- if v:IsA("BodyPosition") then
- table.insert(bodymoverdata, {Mover = v, Vel = v.P})
- end
- if v.Name == "HumanoidRootPart" and v:IsA("BasePart") then
- end
- if v:IsA("Sound") and v.Name ~= "dont" then
- table.insert(sounddata, {Sound = v, Speed = v.PlaybackSpeed})
- end
- end
- dcon2 = workspace.DescendantAdded:connect(function(v)
- swait(2)
- if v:IsA("Humanoid") then
- table.insert(humanoiddata, {Hum = v, WS = v.WalkSpeed, JP = v.JumpPower})
- for _,track in pairs(v:GetPlayingAnimationTracks()) do
- track:AdjustSpeed(1.4)
- end
- local con = v.AnimationPlayed:connect(function(track)
- track:AdjustSpeed(1.4)
- end)
- table.insert(connections, con)
- end
- if v:IsA("BodyVelocity") then
- table.insert(bodymoverdata, {Mover = v, Vel = v.Velocity})
- end
- if v:IsA("BodyPosition") then
- table.insert(bodymoverdata, {Mover = v, Vel = v.P})
- end
- if v.Name == "HumanoidRootPart" and v:IsA("BasePart") then
- end
- if v:IsA("Sound") and v.Name ~= "dont" then
- table.insert(sounddata, {Sound = v, Speed = v.PlaybackSpeed})
- end
- end)
- else
- timefast = false
- soundeffect(soundlist.TimeResume, 1.5, 1, char)
- for i,v in pairs(humanoiddata) do
- pcall(function()
- v["Hum"].WalkSpeed = v["WS"]
- v["Hum"].JumpPower = v["JP"]
- end)
- end
- for i,v in pairs(bodymoverdata) do
- pcall(function()
- if v["Mover"]:IsA("BodyVelocity") then
- v["Mover"].Velocity = v["Vel"]
- end
- if v["Mover"]:IsA("BodyPosition") then
- v["Mover"].P = v["Vel"]
- end
- end)
- end
- for i,v in pairs(sounddata) do
- pcall(function()
- v["Sound"].PlaybackSpeed = v["Speed"]
- end)
- end
- for i,v in pairs(connections) do
- pcall(function()
- v:disconnect()
- end)
- end
- connections = {}
- pcall(function()
- dcon2:disconnect()
- end)
- humanoiddata = {}
- end
- end
- end)
- local reversedata = {}
- local saved = false
- addattack(Enum.KeyCode.C, function()
- if not timestop and not timeslow and not timefast then
- if not saved then
- saved = true
- for i,v in pairs(workspace:GetDescendants()) do
- end
- else
- reversing = true
- saved = false
- soundeffect(soundlist.TimeReverse, 2, 1, workspace)
- for i = 1, 10 do
- for _,v in pairs(reversedata) do
- local obj = v.obj
- local cf = v.cf obj.Anchored = true
- end
- end
- swait()
- end
- char.HumanoidRootPart.Velocity = Vector3.new(0,0,0)
- reversedata = {}
- reversing = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement