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
- --[[-[CUBE OF POLARIS]-----
- This cube was created by TheHeadIessHorseman
- This cube was also TheHeadIessHorsemans first script on SB that was created with Sine and lerp
- KEYDOWNS:
- B = FREEZE MODE ( Slows )
- N = HEAL MODE
- M = DARKNESS MODE ( ACTIVATED T ABILITY )
- Q = SPINNING CUBE ( DMGS WITH FREEZE/HEALS WITH HEAL MODE )
- E = DISINERGRATE
- F = TELEPORT ( PRESS F OVER PLAYER AND CLICK LOCATION )
- T = BLACK HOLE ( DARNKESS )
- --[ ---------------- ]]----
- local Player = game:GetService("Players").LocalPlayer
- repeat wait(1) until Player.Character
- local Character = Player.Character
- local la = Character:FindFirstChild("Left Arm")
- local ra = Character:FindFirstChild("Right Arm")
- local ll = Character:FindFirstChild("Left Leg")
- local rl = Character:FindFirstChild("Right Leg")
- local Torso = Character:FindFirstChild("Torso")
- local Humanoid = Character:findFirstChild("Humanoid")
- Character.Animate:Destroy()
- Humanoid.Animator:Destroy()
- local LimbAccess = {LA=true,RA=true,LL=true,RL=true,RJ=true,NJ=true,Ring=true}
- local State = "Normal"
- local Active = true
- local Mode = "Polaris"
- local mousepos = CFrame.new(0,0,0)
- function Lerp(a,b,i) -- A = First pos, B = Second Pos, i = Speed
- return a:lerp(b,i)
- end
- --Basically it works like this, a is the first position, and b is the position you want to reach. i is the slowness or smoothness factor.
- --They're usually labled x1,y1,alpha
- Left_Arm = Instance.new("Weld",Torso)
- Left_Arm.Part0 = Torso
- Left_Arm.Part1 = la
- Left_Arm.Name = "LeftArmJ"
- Left_Arm.C0 = CFrame.new(-1.5,0.5,0)
- Left_Arm.C1 = CFrame.new(0,0.5,0)
- Right_Arm = Instance.new("Weld",Torso)
- Right_Arm.Part0 = Torso
- Right_Arm.Part1 = ra
- Right_Arm.Name = "RightArmJ"
- Right_Arm.C0 = CFrame.new(1.5,0.5,0)
- Right_Arm.C1 = CFrame.new(0,0.5,0)
- Left_Leg = Instance.new("Weld",Torso)
- Left_Leg.Part0 = Torso
- Left_Leg.Part1 = ll
- Left_Leg.Name = "LeftLegJ"
- Left_Leg.C0 = CFrame.new(-0.5,-1,0)
- Left_Leg.C1 = CFrame.new(0,1,0)
- Right_Leg = Instance.new("Weld",Torso)
- Right_Leg.Name = "RightLegJ"
- Right_Leg.Part0 = Torso
- Right_Leg.Part1 = rl
- Right_Leg.C0 = CFrame.new(0.5,-1,0)
- Right_Leg.C1 = CFrame.new(0,1,0)
- local RootJoint = Instance.new("Weld",Character["HumanoidRootPart"])
- RootJoint.Name = "RootJ"
- RootJoint.Part0 = Character["HumanoidRootPart"]
- RootJoint.Part1 = Torso
- local NeckJ = Instance.new("Weld",Torso)
- NeckJ.Name = "NeckJ"
- NeckJ.Part0 = Torso
- NeckJ.Part1 = Character.Head
- NeckJ.C1 = CFrame.new(0,-1.5,0)
- local Model = Instance.new("Model",Character)
- Model.Name = "RingModel"
- local RingSize = Vector3.new(.5,.5,.5)
- local Ring = Instance.new("Part",Model)
- Ring.Name = "Ring"
- Ring.FormFactor = "Custom"
- Ring.Size = RingSize
- Ring.Anchored = true
- Ring.CanCollide = false
- Ring.BrickColor = BrickColor.new("Really blue")
- Ring.Material = "Neon"
- Ring.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Ring.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Ring.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Ring.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Ring.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Ring.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- local RingClone = Ring:Clone()
- local Sphere = Instance.new("Part")
- Sphere.Shape = "Ball"
- Sphere.Name = "Bound"
- Sphere.Anchored = true
- Sphere.BrickColor = BrickColor.new("Really black")
- Sphere.Transparency = .8
- Sphere.Material = "Neon"
- function CreateRegion3FromLocAndSize(Position, Size)
- local SizeOffset = Size/2
- local Point1 = Position - SizeOffset
- local Point2 = Position + SizeOffset
- return Region3.new(Point1, Point2)
- end
- function ModeAccess(MODE)
- local Colors = {
- Freeze=BrickColor.new("Really red");
- Polaris=BrickColor.new("Really blue");
- Hearth=BrickColor.new("Pastel brown");
- Darkness=BrickColor.new("Really black");
- }
- local Mats = {
- Freeze = "Neon";
- Polaris = "Neon";
- Hearth="Neon";
- Darkness="Neon";
- }
- local Refl = {
- Freeze = .35;
- Polaris = 0;
- Hearth=0;
- Darkness=0;
- }
- LimbAccess.LL = false
- LimbAccess.LA = false
- LimbAccess.RA = false
- LimbAccess.RL = false
- LimbAccess.NJ = false
- LimbAccess.Ring = false
- LimbAccess.RJ = false
- Character.Humanoid.WalkSpeed = 0
- local angle = 0
- local angles = 1
- for i = 1,6,.1 do
- RootJoint.C0 = Lerp(RootJoint.C0,CFrame.new(0,0,0),.1)
- Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1)
- NeckJ.C0 = Lerp(NeckJ.C0,CFrame.new(0,.5,-1)*CFrame.Angles(math.rad(45),0,0),.25)
- Left_Leg.C0 = Lerp(Left_Leg.C0,CFrame.new(-0.5,-1,0)*CFrame.Angles(0,0,math.rad(-2)),.1)
- Right_Leg.C0 = Lerp(Right_Leg.C0,CFrame.new(0.5,-1,0)*CFrame.Angles(0,0,math.rad(2)),.1)
- Right_Arm.C0 = Lerp(Right_Arm.C0,CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(180),math.rad(-5),math.rad(0)),.03)
- Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(0)),.03)
- game:GetService("RunService").RenderStepped:wait()
- end
- for i = 1,6,.1 do
- angle = (angle % 100) + angles/10
- Ring.Size = Lerp(Ring.Size,Vector3.new(5,5,5),.04)
- Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1)
- Right_Arm.C0 = Lerp(Right_Arm.C0,CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(180),math.rad(-5),math.rad(25)),.03)
- Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(-25)),.08)
- game:GetService("RunService").RenderStepped:wait()
- end
- coroutine.resume(coroutine.create(function()
- for i = 0,1,.04 do
- Ring.Transparency = i
- game:GetService("RunService").RenderStepped:wait()
- end
- end))
- for i = 1,6,.1 do
- angle = (angle % 100) + angles/10
- Ring.Size = Lerp(Ring.Size,Vector3.new(0,0,0),.04)
- Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1)
- Right_Arm.C0 = Lerp(Right_Arm.C0,CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(180),math.rad(0),math.rad(5)),.03)
- Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(0)),.08)
- game:GetService("RunService").RenderStepped:wait()
- end
- coroutine.resume(coroutine.create(function()
- for i = 1,0,-.04 do
- Ring.Transparency = i
- game:GetService("RunService").RenderStepped:wait()
- end
- end))
- Ring.BrickColor = Colors[MODE]
- Ring.Material = Mats[MODE]
- Ring.Reflectance = Refl[MODE]
- for i = 1,6,.1 do
- angle = (angle % 100) + angles/10
- Ring.Size = Lerp(Ring.Size,Vector3.new(2,2,2),.04)
- Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1)
- Right_Arm.C0 = Lerp(Right_Arm.C0,CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(180),math.rad(-5),math.rad(25)),.03)
- Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(-25)),.08)
- game:GetService("RunService").RenderStepped:wait()
- end
- Ring.Transparency = 0
- Mode = MODE
- LimbAccess.LL = true
- LimbAccess.LA = true
- LimbAccess.RA = true
- LimbAccess.RL = true
- LimbAccess.NJ = true
- LimbAccess.Ring = true
- LimbAccess.RJ = true
- end
- function Dmg(hit)
- local DB = false
- for i,v in ipairs(game.Workspace:FindPartsInRegion3(hit,nil,80)) do
- if v and v.Parent and v.Parent:FindFirstChild("Head") and v.Parent.Name ~= Player.Name then
- if v.Parent:FindFirstChild("Humanoid") and Mode == "Freeze" then
- v.Parent:FindFirstChild("Humanoid"):TakeDamage(v.Parent:FindFirstChild("Humanoid").MaxHealth*.0006)
- elseif v.Parent:FindFirstChild("Humanoid") and Mode == "Hearth" then
- v.Parent:FindFirstChild("Humanoid").Health = v.Parent:FindFirstChild("Humanoid").Health + (v.Parent:FindFirstChild("Humanoid").MaxHealth*.0006)
- end
- if v.Parent and DB == false then
- DB = true
- for index,object in pairs(v.Parent:GetChildren()) do
- if (object.ClassName == "Humanoid" and object.MaxHealth == math.huge) or (object.ClassName == "Humanoid" and object.ClassName ~= object.Name) then
- object:Destroy()
- break
- end
- end
- end
- if Mode == "Freeze" and v and v.Parent and v.Parent:FindFirstChild("Humanoid") and v.Parent:FindFirstChild("Body Colors") then
- v.Parent:FindFirstChild("Humanoid").WalkSpeed = 3
- local F = Instance.new("Folder",v.Parent)
- F.Name = "BCOLORS"
- v.Parent:FindFirstChild("Body Colors").Parent = F
- coroutine.resume(coroutine.create(function()
- wait(1)
- for i,v in pairs(v.Parent:GetChildren()) do
- if v:IsA("Part") then
- v.BrickColor = BrickColor.new("Pastel light blue")
- end
- end
- end))
- end
- if Mode == "Polaris" and v and v.Parent and v.Parent:FindFirstChild("Humanoid") then
- v.Parent:FindFirstChild("Humanoid").WalkSpeed = 16
- coroutine.resume(coroutine.create(function()
- wait(1)
- if v.Parent and v.Parent:FindFirstChild("BCOLORS") then
- v.Parent:FindFirstChild("BCOLORS")["Body Colors"].Parent = v.Parent
- v.Parent:FindFirstChild("BCOLORS"):Destroy()
- end
- end))
- end
- end
- end
- --[[if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= Player.Name then
- hit.Parent:FindFirstChild("Humanoid"):TakeDamage(10)
- end]]--
- end
- Player:GetMouse().KeyDown:connect(function(key)
- local h=Player:GetMouse().Hit*CFrame.new(0,5,0)
- local a = 0
- local a2 = 0
- local as = .5
- local as2 = 600
- if key == "t" and Active == true and Mode == "Darkness" then
- Active = false
- LimbAccess.Ring = false
- for i = 0,6,.1 do
- Ring.CFrame = Lerp(Ring.CFrame,h,.1)
- game:GetService("RunService").RenderStepped:wait()
- end
- local news = Sphere:Clone()
- news.CanCollide = false
- repeat wait() until Character:FindFirstChild("RingModel")
- news.Parent = Character.RingModel
- news.Size = Vector3.new(100,100,100)
- news.CFrame = Ring.CFrame
- local CF = Ring.CFrame
- coroutine.resume(coroutine.create(function()
- for i = 0,40,.1 do
- a = (a % 100) + as/10
- a2 = (a2 % 100) + as/10
- Ring.Size = Lerp(Ring.Size,Vector3.new(3+math.sin(a2)*1,3+math.sin(a2)*1.5,3+math.sin(a2)*2),.1)
- Ring.CFrame = h*CFrame.Angles(a,0,a)
- news.Size = Lerp(news.Size,Vector3.new(100+math.sin(a2)*1,100+math.sin(a2)*1,100+math.sin(a2)*1),.1)
- news.CFrame = CF
- news.Transparency = .5+(math.sin(a)*.5)
- game:GetService("RunService").RenderStepped:wait()
- end
- end))
- for i = 1,40,.1 do
- for i,v in pairs(game.Players:GetChildren()) do
- if v and v:IsA("Player") and v.Character ~= nil and v.Character:FindFirstChild("Torso") then
- if v and v.Character and v.Character:FindFirstChild("Torso") and v.Name ~= Player.Name then
- if v and v.Character and v.Character.Torso and not v.Character.Torso:FindFirstChild("BOD") and (v.Character.Torso.CFrame.p - Ring.CFrame.p).magnitude < 50 then
- local V = Instance.new("BodyVelocity",v.Character.Torso)
- V.Name = "BOD"
- V.maxForce = Vector3.new(math.huge,math.huge,math.huge)
- end
- if v and v.Character and v.Character:FindFirstChild("Torso") and (v.Character.Torso.CFrame.p - Ring.CFrame.p).magnitude < 50 and v.Name ~= Player.Name then
- v.Character.Torso:FindFirstChild("BOD"). Velocity = CFrame.new(v.Character.Torso.CFrame.p,Ring.CFrame.p).lookVector*(v.Character.Torso.CFrame.p - Ring.CFrame.p).magnitude
- if v and v.Character and v.Character:FindFirstChild("Torso") and (v.Character.Torso.CFrame.p - Ring.CFrame.p).magnitude < 5 and v.Character:FindFirstChild("Humanoid") then
- v.Character:FindFirstChild("Humanoid").Health = v.Character:FindFirstChild("Humanoid").Health - (v.Character:FindFirstChild("Humanoid").MaxHealth*.006)
- end
- end
- end
- end
- end
- game:GetService("RunService").RenderStepped:wait()
- end
- for i,v in pairs(game.Players:GetChildren()) do
- if v and v:IsA("Player") and v.Character and v.Character:FindFirstChild("Torso") and v.Character.Torso:FindFirstChild("BOD") then
- v.Character.Torso:FindFirstChild("BOD"):Destroy()
- end
- end
- for i = news.Transparency,1,-.01 do
- news.Transparency = i
- game:GetService("RunService").RenderStepped:wait()
- end
- LimbAccess.Ring = true
- Active = true
- news:Destroy()
- end
- end)
- Player:GetMouse().KeyDown:connect(function(key)
- local angle = 0
- local anglespeed = 1
- if key == "q" and Active == true then
- Active = false
- LimbAccess.Ring = false
- local x,y,z = 50,50,50
- local pos = Player:GetMouse().Hit
- for i = 0,1,.01 do
- angle = (angle % 100) + anglespeed/10
- Ring.Size = Lerp(Ring.Size,Vector3.new(x,y,z),.05)
- Ring.CFrame = Ring.CFrame:lerp((CFrame.new(pos.p.x,pos.p.y,pos.p.z)*CFrame.new(0,y/2,0)*CFrame.Angles(0,angle,0)),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- for i = 1,10,.1 do
- local reg = CreateRegion3FromLocAndSize(pos.p,Vector3.new(x,y,z))
- Dmg(reg,Mode)
- angle = (angle % 100) + anglespeed/10
- Ring.CFrame = CFrame.new(pos.p.x,pos.p.y,pos.p.z)*CFrame.new(0,y/2,0)*CFrame.Angles(0,angle,0)
- game:GetService("RunService").RenderStepped:wait()
- end
- LimbAccess.Ring = true
- wait(.5)
- Active = true
- end
- end)
- Player:GetMouse().KeyDown:connect(function(key)
- if key == "b" and Active == true then
- Active = false
- ModeAccess("Freeze")
- wait(1)
- Active = true
- Character.Humanoid.WalkSpeed = 16
- elseif key == "p" and Active == true then
- Active = false
- ModeAccess("Polaris")
- wait(1)
- Active = true
- Character.Humanoid.WalkSpeed = 16
- elseif key == "n" and Active == true then
- Active = false
- ModeAccess("Hearth")
- wait(1)
- Active = true
- Character.Humanoid.WalkSpeed = 16
- elseif key == "m" and Active == true then
- Active = false
- ModeAccess("Darkness")
- wait(1)
- Active = true
- Character.Humanoid.WalkSpeed = 16
- end
- end)
- Player:GetMouse().KeyDown:connect(function(key)
- local Object = Player:GetMouse().Target
- if key == "e" and Active == true and Object:IsA("Part") and Object.Name ~= "BasePlate" and Object.Name ~= "Baseplate" and Object.Name ~= "Base" then
- Active = false
- LimbAccess.Ring = false
- for i = 0,1,.01 do
- Ring.Size = Ring.Size:lerp(Object.Size+Vector3.new(.5,.5,.5),i)
- Ring.CFrame = Ring.CFrame:lerp(Object.CFrame,i)
- game:GetService("RunService").RenderStepped:wait()
- end
- for i = 0,.5,.01 do
- Ring.Size = Object.Size+Vector3.new(.5,.5,.5)
- Ring.CFrame = Object.CFrame
- game:GetService("RunService").RenderStepped:wait()
- end
- Object:Destroy()
- wait(.5)
- LimbAccess.Ring = true
- Active = true
- end
- end)
- Player:GetMouse().KeyDown:connect(function(key)
- local H = Player:GetMouse().Target
- if key == "f" and Active == true and H and H.Parent and H.Parent:FindFirstChild("Torso") then
- LimbAccess.Ring = false
- Active = false
- Ring.Anchored = true
- for i = 0,1,.01 do
- Ring.Size = Ring.Size:lerp(Vector3.new(4.5,6,2),i)
- Ring.CFrame = Ring.CFrame:lerp(H.Parent.Torso.CFrame,i)
- game:GetService("RunService").RenderStepped:wait()
- end
- Ring.Anchored = true
- H.Parent.Torso.Anchored = true
- for i = 0,1,.01 do
- Ring.CFrame = Ring.CFrame:lerp(mousepos*CFrame.new(0,2,0),i)
- Ring.CanCollide = false
- H.Parent.HumanoidRootPart.CFrame = H.Parent.HumanoidRootPart.CFrame:lerp(mousepos*CFrame.new(0,2,0),i)
- H.Parent.Torso.Velocity = Vector3.new(0,0,0)
- game:GetService("RunService").RenderStepped:wait()
- end
- H.Parent.Torso.Anchored = false
- Ring.Anchored = true
- LimbAccess.Ring = true
- H.Parent.Humanoid.WalkSpeed = 16
- wait(.7)
- Active = true
- end
- end)
- Player:GetMouse().Button1Down:connect(function()
- mousepos = Player:GetMouse().Hit
- end)
- angle = 0
- angle2 = 0
- angle3 = 0
- anglespeed = 2
- anglespeed2 = 1
- anglespeed3 = .4
- game:GetService("RunService").Stepped:connect(function()
- angle = ((angle % 100) + anglespeed/10)
- angle2 = ((angle2 % 100) + anglespeed2/10)
- angle3 = ((angle3 % 100) + anglespeed3/10) --it'll go from 0 to 100 and repeat in a loop. basically it will get to its destination and back --ok
- if Vector3.new(Torso.Velocity.x,0,Torso.Velocity.z).magnitude < 2 and State == "Normal" then -- idle
- if LimbAccess.RJ then
- RootJoint.C0 = Lerp(RootJoint.C0,CFrame.new(-.5,0,0)*CFrame.Angles(math.sin(angle3)*.02,math.rad(-45),0),.2)
- end
- if LimbAccess.LA then
- Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(97)+(math.sin(angle3))*-.05,0,math.rad(-25)),.1)
- end
- if LimbAccess.NJ then
- NeckJ.C0 = Lerp(NeckJ.C0,CFrame.new(0,0,0)*CFrame.Angles(math.sin(-angle3)*.04,math.rad(45)+(math.sin(-angle3)*.04),0),.25)
- end
- if LimbAccess.RA then
- Right_Arm.C0 = Lerp(Right_Arm.C0,CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(50)+(math.sin(angle3)*.1),math.rad(-20),math.rad(30)),.1)
- end
- if LimbAccess.LL then
- Left_Leg.C0 = Lerp(Left_Leg.C0,CFrame.new(-0.5,-1,0)*CFrame.Angles(0,0,math.rad(-5)+math.sin(angle3)*.02),.1)
- end
- if LimbAccess.RL then
- Right_Leg.C0 = Lerp(Right_Leg.C0,CFrame.new(0.5,-1,0)*CFrame.Angles(0,0,math.rad(15)+math.sin(angle3)*-.02),.1)
- end
- if LimbAccess.Ring then
- Ring.CFrame = Lerp(Ring.CFrame,ra.CFrame*CFrame.new(0,-1.1+math.sin(angle2)*.2,-1)*CFrame.Angles(math.rad(40)+angle2,angle2,angle2),.04)
- Ring.Size = Lerp(Ring.Size,RingSize,.06)
- end
- elseif Vector3.new(Torso.Velocity.x,0,Torso.Velocity.z).magnitude > 2 and State == "Normal" then -- walk
- if LimbAccess.RJ then
- RootJoint.C0 = Lerp(RootJoint.C0,CFrame.new(-.2,math.sin(angle2)*.1,0)*CFrame.Angles(0,math.rad(45),0),.2)
- end
- if LimbAccess.LA then
- Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.2,0.35,0)*CFrame.Angles(math.rad(-25)+math.sin(angle3)*.06,0+math.sin(angle3)*.06,math.rad(15)+math.sin(angle3)*.06),.1)
- end
- if LimbAccess.NJ then
- NeckJ.C0 = Lerp(NeckJ.C0,CFrame.new(0,0,0)*CFrame.Angles(math.sin(-angle3)*.04,math.rad(-45)+(math.sin(-angle3)*.04),0),.25)
- end
- if LimbAccess.RA then
- Right_Arm.C0 = Lerp(Right_Arm.C0,CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(90)+math.sin(angle3)*.05,0,math.rad(40)),.1)
- end
- if LimbAccess.LL then
- Left_Leg.C0 = Lerp(Left_Leg.C0,CFrame.new(-0.5,(math.sin(angle3)*.1)-.6,-.2)*CFrame.Angles(math.rad(-15)+(math.sin(angle3)*.1),0,math.rad(-5)),.1)
- end
- if LimbAccess.RL then
- Right_Leg.C0 = Lerp(Right_Leg.C0,CFrame.new(0.5,(math.sin(angle3)*.1)-.7,-.1)*CFrame.Angles(math.rad(-15)+(math.sin(angle3)*.1),0,math.rad(5)),.1)
- end
- if LimbAccess.Ring then
- local var = math.sin(angle2)*1
- Ring.Size = Lerp(Ring.Size,Vector3.new(2+var,2+var,2+var),.06)
- Ring.CFrame = Lerp(Ring.CFrame,CFrame.new((ra.CFrame*CFrame.new(0,-3,-.3)).p,Player:GetMouse().hit.p),.8)
- Ring.Velocity = Vector3.new(0,0,0)
- end
- end
- if not Character:FindFirstChild("RingModel") or not Character:FindFirstChild("RingModel"):FindFirstChild("Ring") then
- Mode = "Polaris"
- if Character:FindFirstChild("RingModel") then
- local NewRing = RingClone:Clone()
- Ring = NewRing
- Ring.Parent = Character:FindFirstChild("RingModel")
- else
- local Model = Instance.new("Model",Character)
- Model.Name = "RingModel"
- local NewRing = RingClone:Clone()
- Ring = NewRing
- Ring.Parent = Model
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement