SHOW:
|
|
- or go back to the newest paste.
1 | if game:GetService("RunService"):IsClient() then error("Please run as a server script. Use h/ instead of hl/.") end | |
2 | print("FE Compatibility: by WaverlyCole & Mokiros") | |
3 | InternalData = {} | |
4 | do | |
5 | script.Parent = owner.Character | |
6 | local Event = Instance.new("RemoteEvent") | |
7 | Event.Name = "UserInput" | |
8 | local function NewFakeEvent() | |
9 | local Fake = {fakeEvent=true,Connect=function(self,Func)self.Function=Func end}Fake.connect = Fake.Connect | |
10 | return Fake | |
11 | end | |
12 | local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()} | |
13 | local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()} | |
14 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) | |
15 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil | |
16 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
17 | local function TriggerEvent(self,Event,...) | |
18 | local Trigger = Mouse[Event] | |
19 | if Trigger and Trigger.fakeEvent and Trigger.Function then | |
20 | Trigger.Function(...) | |
21 | end | |
22 | end | |
23 | Mouse.TrigEvent = TriggerEvent | |
24 | UserInputService.TrigEvent = TriggerEvent | |
25 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
26 | if FiredBy.Name ~= owner.Name then end | |
27 | if Input.MouseEvent then | |
28 | Mouse.Target = Input.Target | |
29 | Mouse.Hit = Input.Hit | |
30 | else | |
31 | local Begin = Input.UserInputState == Enum.UserInputState.Begin | |
32 | if Input.UserInputType == Enum.UserInputType.MouseButton1 then | |
33 | return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") | |
34 | end | |
35 | for _,Action in pairs(ContextActionService.Actions) do | |
36 | for _,Key in pairs(Action.Keys) do | |
37 | if Key==Input.KeyCode then | |
38 | Action.Function(Action.Name,Input.UserInputState,Input) | |
39 | end | |
40 | end | |
41 | end | |
42 | Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower()) | |
43 | UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false) | |
44 | end | |
45 | end) | |
46 | InternalData["Mouse"] = Mouse | |
47 | InternalData["ContextActionService"] = ContextActionService | |
48 | InternalData["UserInputService"] = UserInputService | |
49 | Event.Parent = NLS([[ | |
50 | local Player = owner | |
51 | local Event = script:WaitForChild("UserInput") | |
52 | local UserInputService = game:GetService("UserInputService") | |
53 | local Mouse = Player:GetMouse() | |
54 | local Input = function(Input,gameProcessedEvent) | |
55 | if gameProcessedEvent then return end | |
56 | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) | |
57 | end | |
58 | UserInputService.InputBegan:Connect(Input) | |
59 | UserInputService.InputEnded:Connect(Input) | |
60 | local Hit,Target | |
61 | while wait(1/30) do | |
62 | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then | |
63 | Hit,Target = Mouse.Hit,Mouse.Target | |
64 | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) | |
65 | end | |
66 | end | |
67 | ]],owner.Character) | |
68 | end | |
69 | RealGame = game;game = setmetatable({},{ | |
70 | __index = function (self,Index) | |
71 | local Sandbox = function (Thing) | |
72 | if Thing:IsA("Player") then | |
73 | local RealPlayer = Thing | |
74 | return setmetatable({},{ | |
75 | __index = function (self,Index) | |
76 | local Type = type(RealPlayer[Index]) | |
77 | if Type == "function" then | |
78 | if Index:lower() == "getmouse" or Index:lower() == "mouse" then | |
79 | return function (self) | |
80 | return InternalData["Mouse"] | |
81 | end | |
82 | end | |
83 | return function (self,...) | |
84 | return RealPlayer[Index](RealPlayer,...) | |
85 | end | |
86 | else | |
87 | if Index == "PlrObj" then | |
88 | return RealPlayer | |
89 | end | |
90 | return RealPlayer[Index] | |
91 | end | |
92 | end; | |
93 | __tostring = function(self) | |
94 | return RealPlayer.Name | |
95 | end | |
96 | }) | |
97 | end | |
98 | end | |
99 | if RealGame[Index] then | |
100 | local Type = type(RealGame[Index]) | |
101 | if Type == "function" then | |
102 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
103 | return function (self,Service) | |
104 | if Service:lower() == "players" then | |
105 | return setmetatable({},{ | |
106 | __index = function (self2,Index2) | |
107 | local RealService = RealGame:GetService(Service) | |
108 | local Type2 = type(Index2) | |
109 | if Type2 == "function" then | |
110 | return function (self,...) | |
111 | return RealService[Index2](RealService,...) | |
112 | end | |
113 | else | |
114 | if Index2:lower() == "localplayer" then | |
115 | return Sandbox(owner) | |
116 | end | |
117 | return RealService[Index2] | |
118 | end | |
119 | end; | |
120 | __tostring = function(self) | |
121 | return RealGame:GetService(Service).Name | |
122 | end | |
123 | }) | |
124 | elseif Service:lower() == "contextactionservice" then | |
125 | return InternalData["ContextActionService"] | |
126 | elseif Service:lower() == "contextactionservice" then | |
127 | return InternalData["UserInputService"] | |
128 | elseif Service:lower() == "runservice" then | |
129 | return setmetatable({},{ | |
130 | __index = function(self2,Index2) | |
131 | local RealService = RealGame:GetService(Service) | |
132 | local Type2 = type(Index2) | |
133 | if Type2 == "function" then | |
134 | return function (self,...) | |
135 | return RealService[Index2](RealService,...) | |
136 | end | |
137 | else | |
138 | if Index2:lower() == "bindtorenderstep" then | |
139 | return function (self,Name,Priority,Function) | |
140 | return RealGame:GetService("RunService").Stepped:Connect(Function) | |
141 | end | |
142 | end | |
143 | if Index2:lower() == "renderstepped" then | |
144 | return RealService["Stepped"] | |
145 | end | |
146 | return RealService[Index2] | |
147 | end | |
148 | end | |
149 | }) | |
150 | else | |
151 | return RealGame:GetService(Service) | |
152 | end | |
153 | end | |
154 | end | |
155 | return function (self,...) | |
156 | return RealGame[Index](RealGame,...) | |
157 | end | |
158 | else | |
159 | if game:GetService(Index) then | |
160 | return game:GetService(Index) | |
161 | end | |
162 | return RealGame[Index] | |
163 | end | |
164 | else | |
165 | return nil | |
166 | end | |
167 | end | |
168 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = {} | |
169 | print("Complete! Running...") | |
170 | ||
171 | ||
172 | --//Paste script below this line. | |
173 | ||
174 | local Services = setmetatable({},{__index = function(t,i) | |
175 | return game:service(i) or nil | |
176 | end}) | |
177 | local Player = Services.Players.LocalPlayer | |
178 | local Mouse = Player:GetMouse() | |
179 | local Character = Player.Character | |
180 | local Human = Character:findFirstChild("Humanoid") | |
181 | local Backpack = Player:WaitForChild("Backpack") | |
182 | local Mouse = Player:GetMouse() | |
183 | local Count = false | |
184 | local Breathing = 0 | |
185 | local Transition = false | |
186 | local Stance = "Standby" | |
187 | ScriptData = { | |
188 | Colors = { | |
189 | Base = "Really black", | |
190 | Trim = "Burnt Sienna", | |
191 | }, | |
192 | Surfaces = { | |
193 | "Top", | |
194 | "Bottom", | |
195 | "Left", | |
196 | "Right", | |
197 | "Front", | |
198 | "Back", | |
199 | }, | |
200 | Rotation = 0, | |
201 | Rotors = {}, | |
202 | Keys = { | |
203 | W = false, | |
204 | A = false, | |
205 | S = false, | |
206 | D = false, | |
207 | Space = false, | |
208 | }, | |
209 | Lift = 2, --Studs off ground | |
210 | TurnAngle = 0, | |
211 | Last = 0, | |
212 | Acceleration = 0, | |
213 | } | |
214 | ||
215 | for _,v in pairs(Character:children()) do | |
216 | if v.Name == "Hover" then | |
217 | v:Destroy() | |
218 | end | |
219 | end | |
220 | local MainModel = Instance.new("Model",Character) | |
221 | MainModel.Name = "Hover" | |
222 | ||
223 | local function CreatePart(StringName,ObjectParent,VectorX,VectorY,VectorZ,StringColor,StringMaterial) | |
224 | local New_Part = Instance.new("Part",ObjectParent) | |
225 | New_Part.Name = StringName | |
226 | New_Part.formFactor = 3 | |
227 | New_Part.Anchored = false | |
228 | New_Part.CanCollide = false | |
229 | New_Part.Locked = true | |
230 | New_Part.BrickColor = BrickColor.new(StringColor) | |
231 | New_Part.Size = Vector3.new(VectorX,VectorY,VectorZ) | |
232 | New_Part.Material = StringMaterial | |
233 | for _,S in pairs(ScriptData.Surfaces) do | |
234 | New_Part[S.."Surface"] = 10 | |
235 | end | |
236 | New_Part:BreakJoints() | |
237 | Instance.new("BlockMesh",New_Part).Name = "Mesh" | |
238 | return New_Part | |
239 | end | |
240 | ||
241 | local function UD(a,b) | |
242 | return UDim2.new(a,0,b,0) | |
243 | end | |
244 | ||
245 | local function Thread(_F) | |
246 | return coroutine.resume(coroutine.create(_F)) | |
247 | end | |
248 | ||
249 | local function CreateWeld(StringName,ObjectParent,Part1,Part0,CFrame1,CFrame0) | |
250 | local New_Weld = Instance.new("Weld",ObjectParent) | |
251 | New_Weld.Name = StringName | |
252 | New_Weld.Part1 = Part1 | |
253 | New_Weld.Part0 = Part0 | |
254 | New_Weld.C1 = CFrame0 | |
255 | New_Weld.C0 = CFrame1 | |
256 | return New_Weld | |
257 | end | |
258 | ||
259 | local function lerp(a, b, c) | |
260 | return a+(b-a)*c | |
261 | end | |
262 | ||
263 | local function AnimLerp(c1, c2, al) | |
264 | local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()} | |
265 | local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()} | |
266 | for i,v in pairs(com1) do | |
267 | com1[i] = lerp(v,com2[i],al) | |
268 | end | |
269 | return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1))) | |
270 | end | |
271 | ||
272 | local Stance = "None" | |
273 | ||
274 | local Head = Character:findFirstChild("Head") | |
275 | local Torso = Character:findFirstChild("Torso") | |
276 | local Root = Character:findFirstChild("HumanoidRootPart") | |
277 | local MotorHolder = Instance.new("Model",MainModel) | |
278 | MotorHolder.Name = "Motors" | |
279 | local Sides = {"Left","Right"} | |
280 | local Arms = {Character["Left Arm"],Character["Right Arm"]} | |
281 | local Legs = {Character["Left Leg"],Character["Right Leg"]} | |
282 | local Welds = { | |
283 | ArmW = { | |
284 | Left = Instance.new("Weld",MotorHolder); | |
285 | Right = Instance.new("Weld",MotorHolder); | |
286 | }; | |
287 | LegW = { | |
288 | Left = Instance.new("Weld",MotorHolder); | |
289 | Right = Instance.new("Weld",MotorHolder); | |
290 | }; | |
291 | HeadW = { | |
292 | Middle = Instance.new("Weld",MotorHolder); | |
293 | }; | |
294 | } | |
295 | local RWelds = { | |
296 | ArmW = { | |
297 | Left = Torso["Left Shoulder"]; | |
298 | Right = Torso["Right Shoulder"]; | |
299 | }; | |
300 | LegW = { | |
301 | Left = Torso["Left Hip"]; | |
302 | Right = Torso["Right Hip"]; | |
303 | }; | |
304 | HeadW = { | |
305 | Middle = Torso["Neck"]; | |
306 | }; | |
307 | } | |
308 | local LA,RA = Welds.ArmW.Left,Welds.ArmW.Right | |
309 | local LL,LR = Welds.LegW.Left,Welds.LegW.Right | |
310 | local HD = Welds.HeadW.Middle | |
311 | local LAD = CFrame.new(-1.5,0.5,0) | |
312 | local RAD = CFrame.new(1.5,0.5,0) | |
313 | local HDD = CFrame.new(0,-0.8,0) | |
314 | Welds.ArmW.Left.C1,Welds.ArmW.Left.C0,Welds.ArmW.Left.Part0 = CFrame.new(0, 0.5, 0),CFrame.new(-1.5, 0.5, 0),Torso | |
315 | Welds.ArmW.Right.C1,Welds.ArmW.Right.C0,Welds.ArmW.Right.Part0 = CFrame.new(0, 0.5, 0),CFrame.new(1.5, 0.5, 0),Torso | |
316 | Welds.LegW.Left.C1,Welds.LegW.Left.Part0 = CFrame.new(.5,2,0),Torso | |
317 | Welds.LegW.Right.C1,Welds.LegW.Right.Part0 = CFrame.new(-.5,2,0),Torso | |
318 | Welds.HeadW.Middle.C1,Welds.HeadW.Middle.Part0 = CFrame.new(0,-1.5,0),Torso | |
319 | local _Arm = function(side,tf) | |
320 | local Arm = nil | |
321 | local Weld = nil | |
322 | local RWeld = nil | |
323 | for _,S in pairs(Sides) do | |
324 | if side:lower() == S:lower() then | |
325 | for _,A in pairs(Arms) do | |
326 | if A.Name:lower():find(side:lower()) then | |
327 | Arm = A | |
328 | Weld = Welds.ArmW[S] | |
329 | RWeld = RWelds.ArmW[S] | |
330 | end | |
331 | end | |
332 | end | |
333 | end | |
334 | if Arm and Weld and RWeld then | |
335 | if tf then | |
336 | Weld.Part1 = Arm | |
337 | RWeld.Part1 = nil | |
338 | elseif not tf then | |
339 | Weld.Part1 = nil | |
340 | RWeld.Part1 = Arm | |
341 | else | |
342 | print("Error") | |
343 | end | |
344 | end | |
345 | end | |
346 | ||
347 | local _Leg = function(side,tf) | |
348 | local Leg = nil | |
349 | local Weld = nil | |
350 | local RWeld = nil | |
351 | for _,S in pairs(Sides) do | |
352 | if side:lower() == S:lower() then | |
353 | for _,A in pairs(Legs) do | |
354 | if A.Name:lower():find(side:lower()) then | |
355 | Leg = A | |
356 | Weld = Welds.LegW[S] | |
357 | RWeld = RWelds.LegW[S] | |
358 | end | |
359 | end | |
360 | end | |
361 | end | |
362 | if Leg and Weld and RWeld then | |
363 | if tf then | |
364 | Weld.Part1 = Leg | |
365 | RWeld.Part1 = nil | |
366 | elseif not tf then | |
367 | Weld.Part1 = nil | |
368 | RWeld.Part1 = Leg | |
369 | else | |
370 | print("Error") | |
371 | end | |
372 | end | |
373 | end | |
374 | ||
375 | local _Head = function(tf) | |
376 | local Head = nil | |
377 | local Weld = nil | |
378 | local RWeld = nil | |
379 | Head = Character["Head"] | |
380 | Weld = Welds.HeadW.Middle | |
381 | RWeld = RWelds.HeadW.Middle | |
382 | if Head and Weld and RWeld then | |
383 | if tf then | |
384 | Weld.Part1 = Head | |
385 | RWeld.Part1 = nil | |
386 | elseif not tf then | |
387 | Weld.Part1 = nil | |
388 | RWeld.Part1 = Head | |
389 | else | |
390 | print("Error") | |
391 | end | |
392 | end | |
393 | end | |
394 | ||
395 | local function Round(Number) | |
396 | return math.floor(Number+.5) | |
397 | end | |
398 | ||
399 | --[[Hover Creation]]-- | |
400 | local Board = CreatePart("Part",MainModel,1.5,0.25,4,ScriptData.Colors.Base,"SmoothPlastic") | |
401 | local BoardEdge = CreatePart("Part",MainModel,1.505,0.2,3.995,ScriptData.Colors.Trim,"Neon") | |
402 | local BEW = CreateWeld("Weld",BoardEdge,BoardEdge,Board,CFrame.new(0,0,0),CFrame.Angles(0,0,0)) | |
403 | -- | |
404 | -- | |
405 | local PointA = CreatePart("Part",MainModel,0.2,0.2,0.2,ScriptData.Colors.Base,"SmoothPlastic") | |
406 | PointA.Transparency = 1 | |
407 | PointA.CanCollide = false | |
408 | local PW = CreateWeld("Weld",PointA,PointA,Board,CFrame.new(0,-0.1,3),CFrame.Angles(math.rad(90),0,0)) | |
409 | local PointB = CreatePart("Part",MainModel,0.2,0.2,0.2,ScriptData.Colors.Base,"SmoothPlastic") | |
410 | PointB.Transparency = 1 | |
411 | PointB.CanCollide = false | |
412 | local PWB = CreateWeld("Weld",PointB,PointB,Board,CFrame.new(0,-0.1,-3),CFrame.Angles(math.rad(90),0,0)) | |
413 | -- | |
414 | -- | |
415 | local BodyPos = Instance.new("BodyPosition",Board) | |
416 | BodyPos.maxForce = Vector3.new(1e5,1e5,1e5) | |
417 | local Tilt = Instance.new("BodyGyro",Board) | |
418 | Tilt.maxTorque = Vector3.new(1,1,1)/0 | |
419 | local Push = Instance.new("BodyForce",Board) | |
420 | Push.force = Vector3.new() | |
421 | --[[Player Welding]]-- | |
422 | ||
423 | if Torso and Human and Board then | |
424 | Human.PlatformStand = true | |
425 | Torso.CFrame = Torso.CFrame*CFrame.new(0,2,0) | |
426 | local TtBW = CreateWeld("Weld",Torso,Torso,Board,CFrame.new(0,3,0),CFrame.Angles(0,math.rad(90),0)) | |
427 | end | |
428 | ||
429 | local function HoverPiece(CF,CFA) | |
430 | local Center = CreatePart("Part",MainModel,0.4,0.2,0.4,"Black","SmoothPlastic") | |
431 | Center:ClearAllChildren() | |
432 | Instance.new("CylinderMesh",Center).Scale = Vector3.new(1,1,1) | |
433 | local Emitter = Instance.new("ParticleEmitter", Center) | |
434 | Emitter.Enabled = true | |
435 | Emitter.Name = "Realism" | |
436 | Emitter.Acceleration = Vector3.new(0.5,0.5,0.5) | |
437 | Emitter.Transparency = NumberSequence.new(0.5,0.8) | |
438 | Emitter.Rate = NumberRange.new(1) | |
439 | local PW1 = CreateWeld("Weld",Center,Center,Board,CF,CFA) | |
440 | local Spin = Center:Clone() | |
441 | Spin.Parent = MainModel | |
442 | Spin.Size = Vector3.new(1,1,1) | |
443 | Spin.Transparency = 1 | |
444 | local SPW = CreateWeld("Weld",Spin,Spin,Center,CFrame.new(0,0,0),CFrame.Angles(0,0,0)) | |
445 | table.insert(ScriptData.Rotors, SPW) | |
446 | for i=0,360,45 do | |
447 | local Part = CreatePart("Part",MainModel,1,0.25,0.25,ScriptData.Colors.Base,"SmoothPlastic") | |
448 | local PW2 = CreateWeld("Weld",Part,Part,Center,CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,1.08),CFrame.Angles(0,0,0)) | |
449 | local Edge = CreatePart("Part",MainModel,1,0.2,0.2,ScriptData.Colors.Trim,"Neon") | |
450 | local EW = CreateWeld("Weld",Edge,Edge,Part,CFrame.new(0,0,0.05),CFrame.Angles(0,0,0)) | |
451 | end | |
452 | for i=0,360,45 do | |
453 | local Rotor = CreatePart("Part",MainModel,2,0.2,0.25,"Burnt Sienna","SmoothPlastic") | |
454 | Rotor:findFirstChild("Mesh").Scale = Vector3.new(1,0.125,1) | |
455 | local RW = CreateWeld("Weld",Rotor,Rotor,Spin,CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,0.2),CFrame.Angles(math.rad(-20),0,0)) | |
456 | end | |
457 | end | |
458 | ||
459 | HoverPiece(CFrame.new(0,0,-2.9),CFrame.Angles(0,0,0)) | |
460 | HoverPiece(CFrame.new(0,0,2.9),CFrame.Angles(0,0,0)) | |
461 | ||
462 | Services.RunService.Stepped:connect(function() | |
463 | pcall(function() | |
464 | for _,v in pairs(ScriptData.Rotors) do | |
465 | if v and v.Parent then | |
466 | v.C0 = v.C0 * CFrame.Angles(0,math.rad(10),0) | |
467 | end | |
468 | end | |
469 | end) | |
470 | a,b = ypcall(function() | |
471 | if Board and Torso and BodyPos and Tilt and PointA and PointB then | |
472 | local Rays = Ray.new(PointA.CFrame.p,PointA.CFrame.lookVector*(ScriptData.Lift + 4 + (ScriptData.Keys.Space==true and 5 or 0))) | |
473 | local Object,Pos = Services.Workspace:findPartOnRay(Rays,Character) | |
474 | local Rays2 = Ray.new(PointB.CFrame.p,PointB.CFrame.lookVector*(ScriptData.Lift + 4 + (ScriptData.Keys.Space==true and 5 or 0))) | |
475 | local Object2,Pos2 = Services.Workspace:findPartOnRay(Rays2,Character) | |
476 | local Left,Right,Front,Back,Space,Accept = 0,0,0,0,0,0 | |
477 | local Face = Board.CFrame.lookVector | |
478 | ||
479 | if ScriptData.Keys.A==true then | |
480 | Left = 1 | |
481 | elseif ScriptData.Keys.D==true then | |
482 | Right = -1 | |
483 | end | |
484 | if ScriptData.Keys.Space==true then | |
485 | Space = 5 | |
486 | else | |
487 | Space = 0 | |
488 | end | |
489 | if ScriptData.Keys.S==true then | |
490 | Back,ScriptData.Last = -2,-1 | |
491 | ScriptData.Acceleration = ScriptData.Acceleration >=8 and 8 or ScriptData.Acceleration + 0.1 | |
492 | elseif ScriptData.Keys.W==true then | |
493 | Front,ScriptData.Last = 2,1 | |
494 | ScriptData.Acceleration = ScriptData.Acceleration >=8 and 8 or ScriptData.Acceleration + 0.1 | |
495 | elseif ScriptData.Acceleration ~= 0 and not ScriptData.Keys.S==true and not ScriptData.Keys.W==true then | |
496 | ScriptData.Acceleration = ScriptData.Acceleration>0 and ScriptData.Acceleration - 0.1 or 0 | |
497 | Accept = ScriptData.Last | |
498 | end | |
499 | ||
500 | ScriptData.TurnAngle = ScriptData.TurnAngle - math.pi*(Left+Right)/32 | |
501 | Tilt.cframe = CFrame.new()*CFrame.Angles(0,-ScriptData.TurnAngle,((Left+Right)/2))*CFrame.Angles(-((Front+Back)/5),0,0) | |
502 | ||
503 | if Object and Object:IsA("BasePart") or Object2 and Object2:IsA("BasePart") then | |
504 | local A = 0 | |
505 | local B = 0 | |
506 | ||
507 | if Object then | |
508 | A = Object.CFrame.Y + Object.Size.Y/2 | |
509 | end | |
510 | if Object2 then | |
511 | B = Object2.CFrame.Y + Object2.Size.Y/2 | |
512 | end | |
513 | BodyPos.maxForce = Vector3.new(1e5,1e5,1e5) | |
514 | BodyPos.position = Vector3.new(Board.CFrame.X,(((A+B)/2)+ScriptData.Lift)+Space,Board.CFrame.Z) + Vector3.new(Face.X,0,Face.Z)*ScriptData.Acceleration*(Front+Back+Accept) | |
515 | else | |
516 | BodyPos.maxForce = Vector3.new(1e5,0,1e5) | |
517 | BodyPos.position = Vector3.new(Board.CFrame.X,Board.CFrame.Y,Board.CFrame.Z) + Vector3.new(Face.X,Space,Face.Z)*ScriptData.Acceleration*(Front+Back+Accept) | |
518 | end | |
519 | end | |
520 | end) | |
521 | if not a then | |
522 | print("E: "..b) | |
523 | end | |
524 | end) | |
525 | ||
526 | Thread(function() | |
527 | while true do | |
528 | for i = 0,10,0.1 do | |
529 | ScriptData.Lift = ScriptData.Lift + (math.sin(math.pi*2/10*i)*0.1) | |
530 | wait(0.02) | |
531 | end | |
532 | end | |
533 | end) | |
534 | ||
535 | Mouse.KeyDown:connect(function(Key) | |
536 | if Key == "w" then | |
537 | ScriptData.Keys.W = true | |
538 | end | |
539 | if Key == "a" then | |
540 | ScriptData.Keys.A = true | |
541 | end | |
542 | if Key == "s" then | |
543 | ScriptData.Keys.S = true | |
544 | end | |
545 | if Key == "d" then | |
546 | ScriptData.Keys.D = true | |
547 | end | |
548 | if Key:byte() == 32 then | |
549 | ScriptData.Keys.Space = true | |
550 | end | |
551 | end) | |
552 | ||
553 | Mouse.KeyUp:connect(function(Key) | |
554 | if Key == "w" then | |
555 | ScriptData.Keys.W = false | |
556 | end | |
557 | if Key == "a" then | |
558 | ScriptData.Keys.A = false | |
559 | end | |
560 | if Key == "s" then | |
561 | ScriptData.Keys.S = false | |
562 | end | |
563 | if Key == "d" then | |
564 | ScriptData.Keys.D = false | |
565 | end | |
566 | if Key:byte() == 32 then | |
567 | ScriptData.Keys.Space = false | |
568 | end | |
569 | end) | |
570 | ||
571 | _Arm("Left", true) | |
572 | _Arm("Right", true) | |
573 | _Leg("Left", true) | |
574 | _Leg("Right", true) | |
575 | _Head(true) | |
576 | ||
577 | Services.RunService.RenderStepped:connect(function() | |
578 | if Transition then | |
579 | if Breathing >= 1 then | |
580 | Transition = false | |
581 | end | |
582 | Breathing = Breathing + 1/100 | |
583 | else | |
584 | if Breathing <= 0 then | |
585 | Transition = true | |
586 | end | |
587 | Breathing = Breathing - 1/100 | |
588 | end | |
589 | ||
590 | if Stance == "None" then | |
591 | LA.C0 = LAD * CFrame.Angles(math.rad(10*Breathing),0,math.rad(-20)) | |
592 | RA.C0 = RAD * CFrame.Angles(math.rad(-10*Breathing),0,math.rad(20)) | |
593 | LL.C0 = CFrame.new() * CFrame.Angles(0,0,math.rad(-5)) | |
594 | LR.C0 = CFrame.new() * CFrame.Angles(0,0,math.rad(5)) | |
595 | end | |
596 | end) |