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 | local i = tostring(math.random(0,10000)) | |
18 | while this.Functions[i] do | |
19 | i = tostring(math.random(0,10000)) | |
20 | end | |
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 | 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 | --[[-[CUBE OF POLARIS]----- | |
153 | This cube was created by TheHeadIessHorseman | |
154 | This cube was also TheHeadIessHorsemans first script on SB that was created with Sine and lerp | |
155 | ||
156 | KEYDOWNS: | |
157 | B = FREEZE MODE ( Slows ) | |
158 | N = HEAL MODE | |
159 | M = DARKNESS MODE ( ACTIVATED T ABILITY ) | |
160 | Q = SPINNING CUBE ( DMGS WITH FREEZE/HEALS WITH HEAL MODE ) | |
161 | E = DISINERGRATE | |
162 | F = TELEPORT ( PRESS F OVER PLAYER AND CLICK LOCATION ) | |
163 | T = BLACK HOLE ( DARNKESS ) | |
164 | --[ ---------------- ]]---- | |
165 | local Player = game:GetService("Players").LocalPlayer | |
166 | repeat wait(1) until Player.Character | |
167 | local Character = Player.Character | |
168 | local la = Character:FindFirstChild("Left Arm") | |
169 | local ra = Character:FindFirstChild("Right Arm") | |
170 | local ll = Character:FindFirstChild("Left Leg") | |
171 | local rl = Character:FindFirstChild("Right Leg") | |
172 | local Torso = Character:FindFirstChild("Torso") | |
173 | local Humanoid = Character:findFirstChild("Humanoid") | |
174 | Character.Animate:Destroy() | |
175 | Humanoid.Animator:Destroy() | |
176 | ||
177 | local LimbAccess = {LA=true,RA=true,LL=true,RL=true,RJ=true,NJ=true,Ring=true} | |
178 | ||
179 | local State = "Normal" | |
180 | local Active = true | |
181 | local Mode = "Polaris" | |
182 | local mousepos = CFrame.new(0,0,0) | |
183 | ||
184 | function Lerp(a,b,i) -- A = First pos, B = Second Pos, i = Speed | |
185 | return a:lerp(b,i) | |
186 | end | |
187 | ||
188 | --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. | |
189 | --They're usually labled x1,y1,alpha | |
190 | ||
191 | Left_Arm = Instance.new("Weld",Torso) | |
192 | Left_Arm.Part0 = Torso | |
193 | Left_Arm.Part1 = la | |
194 | Left_Arm.Name = "LeftArmJ" | |
195 | Left_Arm.C0 = CFrame.new(-1.5,0.5,0) | |
196 | Left_Arm.C1 = CFrame.new(0,0.5,0) | |
197 | Right_Arm = Instance.new("Weld",Torso) | |
198 | Right_Arm.Part0 = Torso | |
199 | Right_Arm.Part1 = ra | |
200 | Right_Arm.Name = "RightArmJ" | |
201 | Right_Arm.C0 = CFrame.new(1.5,0.5,0) | |
202 | Right_Arm.C1 = CFrame.new(0,0.5,0) | |
203 | Left_Leg = Instance.new("Weld",Torso) | |
204 | Left_Leg.Part0 = Torso | |
205 | Left_Leg.Part1 = ll | |
206 | Left_Leg.Name = "LeftLegJ" | |
207 | Left_Leg.C0 = CFrame.new(-0.5,-1,0) | |
208 | Left_Leg.C1 = CFrame.new(0,1,0) | |
209 | Right_Leg = Instance.new("Weld",Torso) | |
210 | Right_Leg.Name = "RightLegJ" | |
211 | Right_Leg.Part0 = Torso | |
212 | Right_Leg.Part1 = rl | |
213 | Right_Leg.C0 = CFrame.new(0.5,-1,0) | |
214 | Right_Leg.C1 = CFrame.new(0,1,0) | |
215 | ||
216 | local RootJoint = Instance.new("Weld",Character["HumanoidRootPart"]) | |
217 | RootJoint.Name = "RootJ" | |
218 | RootJoint.Part0 = Character["HumanoidRootPart"] | |
219 | RootJoint.Part1 = Torso | |
220 | ||
221 | local NeckJ = Instance.new("Weld",Torso) | |
222 | NeckJ.Name = "NeckJ" | |
223 | NeckJ.Part0 = Torso | |
224 | NeckJ.Part1 = Character.Head | |
225 | NeckJ.C1 = CFrame.new(0,-1.5,0) | |
226 | ||
227 | local Model = Instance.new("Model",Character) | |
228 | Model.Name = "RingModel" | |
229 | local RingSize = Vector3.new(.5,.5,.5) | |
230 | local Ring = Instance.new("Part",Model) | |
231 | Ring.Name = "Ring" | |
232 | Ring.FormFactor = "Custom" | |
233 | Ring.Size = RingSize | |
234 | Ring.Anchored = true | |
235 | Ring.CanCollide = false | |
236 | Ring.BrickColor = BrickColor.new("Really blue") | |
237 | Ring.Material = "Neon" | |
238 | Ring.BackSurface = Enum.SurfaceType.SmoothNoOutlines | |
239 | Ring.BottomSurface = Enum.SurfaceType.SmoothNoOutlines | |
240 | Ring.FrontSurface = Enum.SurfaceType.SmoothNoOutlines | |
241 | Ring.LeftSurface = Enum.SurfaceType.SmoothNoOutlines | |
242 | Ring.RightSurface = Enum.SurfaceType.SmoothNoOutlines | |
243 | Ring.TopSurface = Enum.SurfaceType.SmoothNoOutlines | |
244 | ||
245 | local RingClone = Ring:Clone() | |
246 | ||
247 | local Sphere = Instance.new("Part") | |
248 | Sphere.Shape = "Ball" | |
249 | Sphere.Name = "Bound" | |
250 | Sphere.Anchored = true | |
251 | Sphere.BrickColor = BrickColor.new("Really black") | |
252 | Sphere.Transparency = .8 | |
253 | Sphere.Material = "Neon" | |
254 | ||
255 | function CreateRegion3FromLocAndSize(Position, Size) | |
256 | local SizeOffset = Size/2 | |
257 | local Point1 = Position - SizeOffset | |
258 | local Point2 = Position + SizeOffset | |
259 | return Region3.new(Point1, Point2) | |
260 | end | |
261 | ||
262 | function ModeAccess(MODE) | |
263 | local Colors = { | |
264 | Freeze=BrickColor.new("Really red"); | |
265 | Polaris=BrickColor.new("Really blue"); | |
266 | Hearth=BrickColor.new("Pastel brown"); | |
267 | Darkness=BrickColor.new("Really black"); | |
268 | } | |
269 | local Mats = { | |
270 | Freeze = "Neon"; | |
271 | Polaris = "Neon"; | |
272 | Hearth="Neon"; | |
273 | Darkness="Neon"; | |
274 | } | |
275 | local Refl = { | |
276 | Freeze = .35; | |
277 | Polaris = 0; | |
278 | Hearth=0; | |
279 | Darkness=0; | |
280 | } | |
281 | LimbAccess.LL = false | |
282 | LimbAccess.LA = false | |
283 | LimbAccess.RA = false | |
284 | LimbAccess.RL = false | |
285 | LimbAccess.NJ = false | |
286 | LimbAccess.Ring = false | |
287 | LimbAccess.RJ = false | |
288 | Character.Humanoid.WalkSpeed = 0 | |
289 | local angle = 0 | |
290 | local angles = 1 | |
291 | for i = 1,6,.1 do | |
292 | RootJoint.C0 = Lerp(RootJoint.C0,CFrame.new(0,0,0),.1) | |
293 | Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1) | |
294 | NeckJ.C0 = Lerp(NeckJ.C0,CFrame.new(0,.5,-1)*CFrame.Angles(math.rad(45),0,0),.25) | |
295 | Left_Leg.C0 = Lerp(Left_Leg.C0,CFrame.new(-0.5,-1,0)*CFrame.Angles(0,0,math.rad(-2)),.1) | |
296 | Right_Leg.C0 = Lerp(Right_Leg.C0,CFrame.new(0.5,-1,0)*CFrame.Angles(0,0,math.rad(2)),.1) | |
297 | 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) | |
298 | Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(0)),.03) | |
299 | game:GetService("RunService").RenderStepped:wait() | |
300 | end | |
301 | for i = 1,6,.1 do | |
302 | angle = (angle % 100) + angles/10 | |
303 | Ring.Size = Lerp(Ring.Size,Vector3.new(5,5,5),.04) | |
304 | Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1) | |
305 | 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) | |
306 | Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(-25)),.08) | |
307 | game:GetService("RunService").RenderStepped:wait() | |
308 | end | |
309 | coroutine.resume(coroutine.create(function() | |
310 | for i = 0,1,.04 do | |
311 | Ring.Transparency = i | |
312 | game:GetService("RunService").RenderStepped:wait() | |
313 | end | |
314 | end)) | |
315 | for i = 1,6,.1 do | |
316 | angle = (angle % 100) + angles/10 | |
317 | Ring.Size = Lerp(Ring.Size,Vector3.new(0,0,0),.04) | |
318 | Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1) | |
319 | 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) | |
320 | Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(0)),.08) | |
321 | game:GetService("RunService").RenderStepped:wait() | |
322 | end | |
323 | coroutine.resume(coroutine.create(function() | |
324 | for i = 1,0,-.04 do | |
325 | Ring.Transparency = i | |
326 | game:GetService("RunService").RenderStepped:wait() | |
327 | end | |
328 | end)) | |
329 | Ring.BrickColor = Colors[MODE] | |
330 | Ring.Material = Mats[MODE] | |
331 | Ring.Reflectance = Refl[MODE] | |
332 | for i = 1,6,.1 do | |
333 | angle = (angle % 100) + angles/10 | |
334 | Ring.Size = Lerp(Ring.Size,Vector3.new(2,2,2),.04) | |
335 | Ring.CFrame = Lerp(Ring.CFrame,Character.Torso.CFrame*CFrame.new(0,3.5,0)*CFrame.Angles(0,angle,0),.1) | |
336 | 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) | |
337 | Left_Arm.C0 = Lerp(Left_Arm.C0,CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(180),0,math.rad(-25)),.08) | |
338 | game:GetService("RunService").RenderStepped:wait() | |
339 | end | |
340 | Ring.Transparency = 0 | |
341 | Mode = MODE | |
342 | LimbAccess.LL = true | |
343 | LimbAccess.LA = true | |
344 | LimbAccess.RA = true | |
345 | LimbAccess.RL = true | |
346 | LimbAccess.NJ = true | |
347 | LimbAccess.Ring = true | |
348 | LimbAccess.RJ = true | |
349 | end | |
350 | ||
351 | function Dmg(hit) | |
352 | local DB = false | |
353 | ||
354 | for i,v in ipairs(game.Workspace:FindPartsInRegion3(hit,nil,80)) do | |
355 | if v and v.Parent and v.Parent:FindFirstChild("Head") and v.Parent.Name ~= Player.Name then | |
356 | if v.Parent:FindFirstChild("Humanoid") and Mode == "Freeze" then | |
357 | v.Parent:FindFirstChild("Humanoid"):TakeDamage(v.Parent:FindFirstChild("Humanoid").MaxHealth*.0006) | |
358 | elseif v.Parent:FindFirstChild("Humanoid") and Mode == "Hearth" then | |
359 | v.Parent:FindFirstChild("Humanoid").Health = v.Parent:FindFirstChild("Humanoid").Health + (v.Parent:FindFirstChild("Humanoid").MaxHealth*.0006) | |
360 | end | |
361 | ||
362 | if v.Parent and DB == false then | |
363 | DB = true | |
364 | for index,object in pairs(v.Parent:GetChildren()) do | |
365 | if (object.ClassName == "Humanoid" and object.MaxHealth == math.huge) or (object.ClassName == "Humanoid" and object.ClassName ~= object.Name) then | |
366 | object:Destroy() | |
367 | break | |
368 | end | |
369 | end | |
370 | end | |
371 | ||
372 | if Mode == "Freeze" and v and v.Parent and v.Parent:FindFirstChild("Humanoid") and v.Parent:FindFirstChild("Body Colors") then | |
373 | v.Parent:FindFirstChild("Humanoid").WalkSpeed = 3 | |
374 | local F = Instance.new("Folder",v.Parent) | |
375 | F.Name = "BCOLORS" | |
376 | ||
377 | v.Parent:FindFirstChild("Body Colors").Parent = F | |
378 | coroutine.resume(coroutine.create(function() | |
379 | wait(1) | |
380 | for i,v in pairs(v.Parent:GetChildren()) do | |
381 | if v:IsA("Part") then | |
382 | v.BrickColor = BrickColor.new("Pastel light blue") | |
383 | end | |
384 | end | |
385 | end)) | |
386 | end | |
387 | if Mode == "Polaris" and v and v.Parent and v.Parent:FindFirstChild("Humanoid") then | |
388 | v.Parent:FindFirstChild("Humanoid").WalkSpeed = 16 | |
389 | coroutine.resume(coroutine.create(function() | |
390 | wait(1) | |
391 | if v.Parent and v.Parent:FindFirstChild("BCOLORS") then | |
392 | v.Parent:FindFirstChild("BCOLORS")["Body Colors"].Parent = v.Parent | |
393 | v.Parent:FindFirstChild("BCOLORS"):Destroy() | |
394 | end | |
395 | end)) | |
396 | end | |
397 | ||
398 | end | |
399 | end | |
400 | --[[if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= Player.Name then | |
401 | hit.Parent:FindFirstChild("Humanoid"):TakeDamage(10) | |
402 | end]]-- | |
403 | end | |
404 | Player:GetMouse().KeyDown:connect(function(key) | |
405 | local h=Player:GetMouse().Hit*CFrame.new(0,5,0) | |
406 | local a = 0 | |
407 | local a2 = 0 | |
408 | local as = .5 | |
409 | local as2 = 600 | |
410 | if key == "t" and Active == true and Mode == "Darkness" then | |
411 | Active = false | |
412 | LimbAccess.Ring = false | |
413 | for i = 0,6,.1 do | |
414 | Ring.CFrame = Lerp(Ring.CFrame,h,.1) | |
415 | game:GetService("RunService").RenderStepped:wait() | |
416 | end | |
417 | local news = Sphere:Clone() | |
418 | news.CanCollide = false | |
419 | repeat wait() until Character:FindFirstChild("RingModel") | |
420 | news.Parent = Character.RingModel | |
421 | news.Size = Vector3.new(100,100,100) | |
422 | news.CFrame = Ring.CFrame | |
423 | local CF = Ring.CFrame | |
424 | coroutine.resume(coroutine.create(function() | |
425 | for i = 0,40,.1 do | |
426 | a = (a % 100) + as/10 | |
427 | a2 = (a2 % 100) + as/10 | |
428 | Ring.Size = Lerp(Ring.Size,Vector3.new(3+math.sin(a2)*1,3+math.sin(a2)*1.5,3+math.sin(a2)*2),.1) | |
429 | Ring.CFrame = h*CFrame.Angles(a,0,a) | |
430 | news.Size = Lerp(news.Size,Vector3.new(100+math.sin(a2)*1,100+math.sin(a2)*1,100+math.sin(a2)*1),.1) | |
431 | news.CFrame = CF | |
432 | news.Transparency = .5+(math.sin(a)*.5) | |
433 | game:GetService("RunService").RenderStepped:wait() | |
434 | end | |
435 | end)) | |
436 | for i = 1,40,.1 do | |
437 | for i,v in pairs(game.Players:GetChildren()) do | |
438 | if v and v:IsA("Player") and v.Character ~= nil and v.Character:FindFirstChild("Torso") then | |
439 | if v and v.Character and v.Character:FindFirstChild("Torso") and v.Name ~= Player.Name then | |
440 | 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 | |
441 | local V = Instance.new("BodyVelocity",v.Character.Torso) | |
442 | V.Name = "BOD" | |
443 | V.maxForce = Vector3.new(math.huge,math.huge,math.huge) | |
444 | end | |
445 | 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 | |
446 | 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 | |
447 | 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 | |
448 | v.Character:FindFirstChild("Humanoid").Health = v.Character:FindFirstChild("Humanoid").Health - (v.Character:FindFirstChild("Humanoid").MaxHealth*.006) | |
449 | end | |
450 | end | |
451 | end | |
452 | end | |
453 | end | |
454 | game:GetService("RunService").RenderStepped:wait() | |
455 | end | |
456 | for i,v in pairs(game.Players:GetChildren()) do | |
457 | if v and v:IsA("Player") and v.Character and v.Character:FindFirstChild("Torso") and v.Character.Torso:FindFirstChild("BOD") then | |
458 | v.Character.Torso:FindFirstChild("BOD"):Destroy() | |
459 | end | |
460 | end | |
461 | for i = news.Transparency,1,-.01 do | |
462 | news.Transparency = i | |
463 | game:GetService("RunService").RenderStepped:wait() | |
464 | end | |
465 | LimbAccess.Ring = true | |
466 | Active = true | |
467 | news:Destroy() | |
468 | end | |
469 | end) | |
470 | Player:GetMouse().KeyDown:connect(function(key) | |
471 | local angle = 0 | |
472 | local anglespeed = 1 | |
473 | if key == "q" and Active == true then | |
474 | Active = false | |
475 | LimbAccess.Ring = false | |
476 | local x,y,z = 50,50,50 | |
477 | local pos = Player:GetMouse().Hit | |
478 | for i = 0,1,.01 do | |
479 | angle = (angle % 100) + anglespeed/10 | |
480 | Ring.Size = Lerp(Ring.Size,Vector3.new(x,y,z),.05) | |
481 | 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) | |
482 | game:GetService("RunService").RenderStepped:wait() | |
483 | end | |
484 | for i = 1,10,.1 do | |
485 | local reg = CreateRegion3FromLocAndSize(pos.p,Vector3.new(x,y,z)) | |
486 | Dmg(reg,Mode) | |
487 | ||
488 | angle = (angle % 100) + anglespeed/10 | |
489 | Ring.CFrame = CFrame.new(pos.p.x,pos.p.y,pos.p.z)*CFrame.new(0,y/2,0)*CFrame.Angles(0,angle,0) | |
490 | game:GetService("RunService").RenderStepped:wait() | |
491 | end | |
492 | LimbAccess.Ring = true | |
493 | wait(.5) | |
494 | Active = true | |
495 | end | |
496 | end) | |
497 | Player:GetMouse().KeyDown:connect(function(key) | |
498 | ||
499 | if key == "b" and Active == true then | |
500 | Active = false | |
501 | ModeAccess("Freeze") | |
502 | wait(1) | |
503 | Active = true | |
504 | Character.Humanoid.WalkSpeed = 16 | |
505 | elseif key == "p" and Active == true then | |
506 | Active = false | |
507 | ModeAccess("Polaris") | |
508 | wait(1) | |
509 | Active = true | |
510 | Character.Humanoid.WalkSpeed = 16 | |
511 | elseif key == "n" and Active == true then | |
512 | Active = false | |
513 | ModeAccess("Hearth") | |
514 | wait(1) | |
515 | Active = true | |
516 | Character.Humanoid.WalkSpeed = 16 | |
517 | elseif key == "m" and Active == true then | |
518 | Active = false | |
519 | ModeAccess("Darkness") | |
520 | wait(1) | |
521 | Active = true | |
522 | Character.Humanoid.WalkSpeed = 16 | |
523 | end | |
524 | end) | |
525 | ||
526 | Player:GetMouse().KeyDown:connect(function(key) | |
527 | local Object = Player:GetMouse().Target | |
528 | if key == "e" and Active == true and Object:IsA("Part") and Object.Name ~= "BasePlate" and Object.Name ~= "Baseplate" and Object.Name ~= "Base" then | |
529 | Active = false | |
530 | LimbAccess.Ring = false | |
531 | for i = 0,1,.01 do | |
532 | Ring.Size = Ring.Size:lerp(Object.Size+Vector3.new(.5,.5,.5),i) | |
533 | Ring.CFrame = Ring.CFrame:lerp(Object.CFrame,i) | |
534 | game:GetService("RunService").RenderStepped:wait() | |
535 | end | |
536 | for i = 0,.5,.01 do | |
537 | Ring.Size = Object.Size+Vector3.new(.5,.5,.5) | |
538 | Ring.CFrame = Object.CFrame | |
539 | game:GetService("RunService").RenderStepped:wait() | |
540 | end | |
541 | Object:Destroy() | |
542 | wait(.5) | |
543 | LimbAccess.Ring = true | |
544 | Active = true | |
545 | end | |
546 | end) | |
547 | Player:GetMouse().KeyDown:connect(function(key) | |
548 | local H = Player:GetMouse().Target | |
549 | if key == "f" and Active == true and H and H.Parent and H.Parent:FindFirstChild("Torso") then | |
550 | LimbAccess.Ring = false | |
551 | Active = false | |
552 | Ring.Anchored = true | |
553 | for i = 0,1,.01 do | |
554 | Ring.Size = Ring.Size:lerp(Vector3.new(4.5,6,2),i) | |
555 | Ring.CFrame = Ring.CFrame:lerp(H.Parent.Torso.CFrame,i) | |
556 | game:GetService("RunService").RenderStepped:wait() | |
557 | end | |
558 | Ring.Anchored = true | |
559 | H.Parent.Torso.Anchored = true | |
560 | for i = 0,1,.01 do | |
561 | Ring.CFrame = Ring.CFrame:lerp(mousepos*CFrame.new(0,2,0),i) | |
562 | Ring.CanCollide = false | |
563 | H.Parent.HumanoidRootPart.CFrame = H.Parent.HumanoidRootPart.CFrame:lerp(mousepos*CFrame.new(0,2,0),i) | |
564 | H.Parent.Torso.Velocity = Vector3.new(0,0,0) | |
565 | game:GetService("RunService").RenderStepped:wait() | |
566 | end | |
567 | H.Parent.Torso.Anchored = false | |
568 | Ring.Anchored = true | |
569 | LimbAccess.Ring = true | |
570 | H.Parent.Humanoid.WalkSpeed = 16 | |
571 | wait(.7) | |
572 | Active = true | |
573 | end | |
574 | end) | |
575 | ||
576 | ||
577 | ||
578 | Player:GetMouse().Button1Down:connect(function() | |
579 | mousepos = Player:GetMouse().Hit | |
580 | end) | |
581 | ||
582 | ||
583 | angle = 0 | |
584 | angle2 = 0 | |
585 | angle3 = 0 | |
586 | anglespeed = 2 | |
587 | anglespeed2 = 1 | |
588 | anglespeed3 = .4 | |
589 | game:GetService("RunService").Stepped:connect(function() | |
590 | angle = ((angle % 100) + anglespeed/10) | |
591 | angle2 = ((angle2 % 100) + anglespeed2/10) | |
592 | 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 | |
593 | if Vector3.new(Torso.Velocity.x,0,Torso.Velocity.z).magnitude < 2 and State == "Normal" then -- idle | |
594 | if LimbAccess.RJ then | |
595 | RootJoint.C0 = Lerp(RootJoint.C0,CFrame.new(-.5,0,0)*CFrame.Angles(math.sin(angle3)*.02,math.rad(-45),0),.2) | |
596 | end | |
597 | if LimbAccess.LA then | |
598 | 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) | |
599 | end | |
600 | if LimbAccess.NJ then | |
601 | 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) | |
602 | end | |
603 | if LimbAccess.RA then | |
604 | 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) | |
605 | end | |
606 | if LimbAccess.LL then | |
607 | 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) | |
608 | end | |
609 | if LimbAccess.RL then | |
610 | 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) | |
611 | end | |
612 | if LimbAccess.Ring then | |
613 | 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) | |
614 | Ring.Size = Lerp(Ring.Size,RingSize,.06) | |
615 | end | |
616 | elseif Vector3.new(Torso.Velocity.x,0,Torso.Velocity.z).magnitude > 2 and State == "Normal" then -- walk | |
617 | if LimbAccess.RJ then | |
618 | RootJoint.C0 = Lerp(RootJoint.C0,CFrame.new(-.2,math.sin(angle2)*.1,0)*CFrame.Angles(0,math.rad(45),0),.2) | |
619 | end | |
620 | if LimbAccess.LA then | |
621 | 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) | |
622 | end | |
623 | if LimbAccess.NJ then | |
624 | 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) | |
625 | end | |
626 | if LimbAccess.RA then | |
627 | 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) | |
628 | end | |
629 | if LimbAccess.LL then | |
630 | 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) | |
631 | end | |
632 | if LimbAccess.RL then | |
633 | 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) | |
634 | end | |
635 | if LimbAccess.Ring then | |
636 | local var = math.sin(angle2)*1 | |
637 | Ring.Size = Lerp(Ring.Size,Vector3.new(2+var,2+var,2+var),.06) | |
638 | Ring.CFrame = Lerp(Ring.CFrame,CFrame.new((ra.CFrame*CFrame.new(0,-3,-.3)).p,Player:GetMouse().hit.p),.8) | |
639 | Ring.Velocity = Vector3.new(0,0,0) | |
640 | end | |
641 | end | |
642 | if not Character:FindFirstChild("RingModel") or not Character:FindFirstChild("RingModel"):FindFirstChild("Ring") then | |
643 | Mode = "Polaris" | |
644 | if Character:FindFirstChild("RingModel") then | |
645 | local NewRing = RingClone:Clone() | |
646 | Ring = NewRing | |
647 | Ring.Parent = Character:FindFirstChild("RingModel") | |
648 | else | |
649 | local Model = Instance.new("Model",Character) | |
650 | Model.Name = "RingModel" | |
651 | local NewRing = RingClone:Clone() | |
652 | Ring = NewRing | |
653 | Ring.Parent = Model | |
654 | end | |
655 | end | |
656 | end) |