SHOW:
|
|
- or go back to the newest paste.
1 | --//====================================================\\-- | |
2 | --|| CREATED BY SHACKLUSTER | |
3 | --\\====================================================//-- | |
4 | ||
5 | - | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end |
5 | + | if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility by WaverlyCole");InternalData = {}InternalData.RealOwner = owner;InternalData.Version = "v1.0.0" |
6 | - | local Player,game,owner = owner,game |
6 | + | |
7 | - | local RealPlayer = Player |
7 | + | script.Parent = InternalData.RealOwner.Character |
8 | local Event = Instance.new("RemoteEvent");Event.Name = "UserInput" | |
9 | - | print("FE Compatibility code by Mokiros") |
9 | + | local function createObject (connections, index) |
10 | - | local rp = RealPlayer |
10 | + | local proxy = newproxy (true);local meta = getmetatable (proxy); |
11 | - | script.Parent = rp.Character |
11 | + | local runbind = function (self, i, ...) connections[i]:Fire (...); end; |
12 | - | |
12 | + | while (#connections > 0) do connections [table.remove (connections, 1)] = Instance.new ('BindableEvent');end; |
13 | - | --RemoteEvent for communicating |
13 | + | meta.__index = function (self, i) |
14 | - | local Event = Instance.new("RemoteEvent") |
14 | + | if (i == 'TriggerEvent') then return runbind end; |
15 | - | Event.Name = "UserInput_Event" |
15 | + | return connections[i] and connections[i].Event or index[i]; |
16 | end; | |
17 | - | --Fake event to make stuff like Mouse.KeyDown work |
17 | + | meta.__newindex = index;meta.__metatable = false;return proxy |
18 | - | local function fakeEvent() |
18 | + | end; |
19 | - | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end} |
19 | + | local Mouse = createObject({"KeyUp","KeyDown","Button1Down","Button1Up"},{["Target"] = nil;["Hit"] = CFrame.new()}) |
20 | - | t.connect = t.Connect |
20 | + | local UserInputService = createObject({"InputBegan","InputEnded"},{}) |
21 | - | return t |
21 | + | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) |
22 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil | |
23 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
24 | - | --Creating fake input objects with fake variables |
24 | + | Event.OnServerEvent:Connect(function(FiredBy,Input) |
25 | - | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} |
25 | + | if FiredBy.Name ~= InternalData.RealOwner.Name then return end |
26 | - | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} |
26 | + | if Input.MouseEvent then |
27 | - | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) |
27 | + | Mouse.Target = Input.Target;Mouse.Hit = Input.Hit |
28 | - | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil |
28 | + | else |
29 | - | end} |
29 | + | local Begin = Input.UserInputState == Enum.UserInputState.Begin |
30 | - | --Merged 2 functions into one by checking amount of arguments |
30 | + | if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TriggerEvent(Begin and "Button1Down" or "Button1Up") end |
31 | - | CAS.UnbindAction = CAS.BindAction |
31 | + | for _,Action in pairs(ContextActionService.Actions) do |
32 | for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end | |
33 | - | --This function will trigger the events that have been :Connect()'ed |
33 | + | end |
34 | - | local function te(self,ev,...) |
34 | + | Mouse:TriggerEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower());UserInputService:TriggerEvent(Begin and "InputBegan" or "InputEnded",Input,false) |
35 | - | local t = m[ev] |
35 | + | end |
36 | - | if t and t._fakeEvent then |
36 | + | end) |
37 | - | for _,f in pairs(t.Functions) do |
37 | + | InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService |
38 | - | f(...) |
38 | + | Event.Parent = NLS([[ |
39 | local Player = owner; | |
40 | local Event = script:WaitForChild("UserInput"); | |
41 | local UserInputService = game:GetService("UserInputService"); | |
42 | - | m.TrigEvent = te |
42 | + | local Mouse = Player:GetMouse(); |
43 | - | UIS.TrigEvent = te |
43 | + | local Input = function(Input,gameProcessedEvent) |
44 | if gameProcessedEvent then return end | |
45 | - | Event.OnServerEvent:Connect(function(plr,io) |
45 | + | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) |
46 | - | if plr~=rp then return end |
46 | + | end |
47 | - | m.Target = io.Target |
47 | + | UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input) |
48 | - | m.Hit = io.Hit |
48 | + | local Hit,Target |
49 | - | if not io.isMouse then |
49 | + | while wait(1/60) do |
50 | - | local b = io.UserInputState == Enum.UserInputState.Begin |
50 | + | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then |
51 | - | if io.UserInputType == Enum.UserInputType.MouseButton1 then |
51 | + | Hit = Mouse.Hit;Target = Mouse.Target; |
52 | - | return m:TrigEvent(b and "Button1Down" or "Button1Up") |
52 | + | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) |
53 | end | |
54 | - | for _,t in pairs(CAS.Actions) do |
54 | + | end |
55 | - | for _,k in pairs(t.Keys) do |
55 | + | ]],InternalData.RealOwner.Character) |
56 | - | if k==io.KeyCode then |
56 | + | |
57 | - | t.Function(t.Name,io.UserInputState,io) |
57 | + | InternalData.RealInstance = Instance;Instance = setmetatable({},{ |
58 | __index = function (self,Index) | |
59 | if Index:lower() == 'new' then | |
60 | return function (Type, Parent) | |
61 | - | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) |
61 | + | local Real = InternalData.RealInstance.new(Type,Parent) |
62 | - | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) |
62 | + | if not Type then return end |
63 | - | end |
63 | + | if Type == "BillboardGui" then |
64 | return setmetatable({},{ | |
65 | - | Event.Parent = NLS([==[ |
65 | + | __index = function (self,Index) |
66 | - | local Player = game:GetService("Players").LocalPlayer |
66 | + | return Real[Index] |
67 | - | local Event = script:WaitForChild("UserInput_Event") |
67 | + | end; |
68 | __newindex = function (self,Index,Value) | |
69 | - | local Mouse = Player:GetMouse() |
69 | + | if Index:lower() == "playertohidefrom" then |
70 | - | local UIS = game:GetService("UserInputService") |
70 | + | if Value.Name == owner.Name then Real[Index] = InternalData.RealOwner else Real[Index] = Value end |
71 | - | local input = function(io,a) |
71 | + | else |
72 | - | if a then return end |
72 | + | Real[Index] = Value |
73 | - | --Since InputObject is a client-side instance, we create and pass table instead |
73 | + | end |
74 | - | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target}) |
74 | + | end; |
75 | __tostring = function(self) return tostring(Real) end; | |
76 | - | UIS.InputBegan:Connect(input) |
76 | + | }) |
77 | - | UIS.InputEnded:Connect(input) |
77 | + | end |
78 | return Real | |
79 | - | local h,t |
79 | + | end |
80 | - | --Give the server mouse data 30 times every second, but only if the values changed |
80 | + | end |
81 | - | --If player is not moving their mouse, client won't fire events |
81 | + | return InternalData.RealInstance[Index] |
82 | - | while wait(1/30) do |
82 | + | end; |
83 | - | if h~=Mouse.Hit or t~=Mouse.Target then |
83 | + | __tostring = function(self) return tostring(InternalData.RealInstance) end; |
84 | - | h,t=Mouse.Hit,Mouse.Target |
84 | + | }); |
85 | - | Event:FireServer({isMouse=true,Target=t,Hit=h}) |
85 | + | InternalData.RealGame = game;game = setmetatable({},{ |
86 | __index = function (self,Index) | |
87 | - | end]==],Player.Character) |
87 | + | local Sandbox = function (Thing) |
88 | if Thing:IsA("Player") then | |
89 | - | ----Sandboxed game object that allows the usage of client-side methods and services |
89 | + | local RealPlayer = Thing |
90 | - | --Real game object |
90 | + | return setmetatable({},{ |
91 | - | local _rg = game |
91 | + | __index = function (self,Index) |
92 | local Type = type(RealPlayer[Index]) | |
93 | - | --Metatable for fake service |
93 | + | if Type == "function" then |
94 | - | local fsmt = { |
94 | + | if Index:lower() == "getmouse" or Index:lower() == "mouse" then |
95 | - | __index = function(self,k) |
95 | + | return function (self)return InternalData["Mouse"] end |
96 | - | local s = rawget(self,"_RealService") |
96 | + | end |
97 | - | if s then return s[k] end |
97 | + | return function (self,...)return RealPlayer[Index](RealPlayer,...) end |
98 | - | end, |
98 | + | elseif Index == "FakePlayer" then |
99 | - | __newindex = function(self,k,v) |
99 | + | return true |
100 | - | local s = rawget(self,"_RealService") |
100 | + | end |
101 | - | if s then s[k]=v end |
101 | + | return RealPlayer[Index] |
102 | - | end, |
102 | + | end; |
103 | - | __call = function(self,...) |
103 | + | __tostring = function(self) return tostring(RealPlayer) end |
104 | - | local s = rawget(self,"_RealService") |
104 | + | }) |
105 | - | if s then return s(...) end |
105 | + | end |
106 | end | |
107 | - | } |
107 | + | if InternalData.RealGame[Index] then |
108 | - | local function FakeService(t,RealService) |
108 | + | local Type = type(InternalData.RealGame[Index]) |
109 | - | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService |
109 | + | if Type == "function" then |
110 | - | return setmetatable(t,fsmt) |
110 | + | if Index:lower() == "getservice" or Index:lower() == "service" then |
111 | return function (self,Service) | |
112 | local FakeServices = { | |
113 | - | --Fake game object |
113 | + | ["players"] = function() |
114 | - | local g = { |
114 | + | return setmetatable({},{ |
115 | - | GetService = function(self,s) |
115 | + | __index = function (self2,Index2) |
116 | - | return self[s] |
116 | + | local RealService = InternalData.RealGame:GetService(Service) |
117 | - | end, |
117 | + | local Type2 = type(Index2) |
118 | - | Players = FakeService({ |
118 | + | if Type2 == "function" then |
119 | - | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player) |
119 | + | return function (self,...) return RealService[Index2](RealService,...)end |
120 | - | },"Players"), |
120 | + | else |
121 | - | UserInputService = FakeService(UIS,"UserInputService"), |
121 | + | if Index2:lower() == "localplayer" then return Sandbox(InternalData.RealOwner) end |
122 | - | ContextActionService = FakeService(CAS,"ContextActionService"), |
122 | + | return RealService[Index2] |
123 | - | } |
123 | + | end |
124 | - | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) |
124 | + | end; |
125 | - | g.service = g.GetService |
125 | + | __tostring = function(self) return tostring(InternalData.RealGame:GetService(Service)) end |
126 | - | |
126 | + | }) |
127 | - | g.RunService = FakeService({ |
127 | + | end; |
128 | - | RenderStepped = _rg:GetService("RunService").Heartbeat, |
128 | + | ["contextactionservice"] = function() return InternalData["ContextActionService"] end; |
129 | - | BindToRenderStep = function(self,name,_,fun) |
129 | + | ["userinputservice"] = function() return InternalData["UserInputService"] end; |
130 | - | self._btrs[name] = self.Heartbeat:Connect(fun) |
130 | + | ["runservice"] = function() |
131 | - | end, |
131 | + | return setmetatable({},{ |
132 | - | UnbindFromRenderStep = function(self,name) |
132 | + | __index = function(self2,Index2) |
133 | - | self._btrs[name]:Disconnect() |
133 | + | local RealService = InternalData.RealGame:GetService(Service) |
134 | - | end, |
134 | + | local Type2 = type(Index2) |
135 | - | },"RunService") |
135 | + | if Type2 == "function" then |
136 | return function (self,...) return RealService[Index2](RealService,...) end | |
137 | - | setmetatable(g,{ |
137 | + | else |
138 | - | __index=function(self,s) |
138 | + | local RunServices = { |
139 | - | return _rg:GetService(s) or typeof(_rg[s])=="function" |
139 | + | ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return InternalData.RealGame:GetService("RunService").Stepped:Connect(Function) end end; |
140 | - | and function(_,...)return _rg[s](_rg,...)end or _rg[s] |
140 | + | ["renderstepped"] = function() return RealService["Stepped"] end |
141 | - | end, |
141 | + | } |
142 | - | __newindex = fsmt.__newindex, |
142 | + | if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end |
143 | - | __call = fsmt.__call |
143 | + | return RealService[Index2] |
144 | - | }) |
144 | + | end |
145 | - | --Changing owner to fake player object to support owner:GetMouse() |
145 | + | end; |
146 | - | game,owner = g,g.Players.LocalPlayer |
146 | + | __tostring = function(self) return tostring(InternalData.RealGame:GetService("RunService")) end |
147 | }) | |
148 | - | print("VengefulProgram is sexy from dreamer no homo") |
148 | + | end |
149 | } | |
150 | if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end | |
151 | return InternalData.RealGame:GetService(Service) | |
152 | end | |
153 | end | |
154 | return function (self,...) return InternalData.RealGame[Index](InternalData.RealGame,...) end | |
155 | else | |
156 | if game:GetService(Index) then return game:GetService(Index) end | |
157 | return InternalData.RealGame[Index] | |
158 | end | |
159 | end | |
160 | return nil | |
161 | end; | |
162 | __tostring = function(self) return tostring(InternalData.game) end | |
163 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete!") | |
164 | ||
165 | --//Paste script below this line. | |
166 | Player = game:GetService("Players").LocalPlayer | |
167 | PlayerGui = Player.PlayerGui | |
168 | Cam = workspace.CurrentCamera | |
169 | Backpack = Player.Backpack | |
170 | Character = Player.Character | |
171 | Humanoid = Character.Humanoid | |
172 | Mouse = Player:GetMouse() | |
173 | RootPart = Character["HumanoidRootPart"] | |
174 | Torso = Character["Torso"] | |
175 | Head = Character["Head"] | |
176 | RightArm = Character["Right Arm"] | |
177 | LeftArm = Character["Left Arm"] | |
178 | RightLeg = Character["Right Leg"] | |
179 | LeftLeg = Character["Left Leg"] | |
180 | RootJoint = RootPart["RootJoint"] | |
181 | Neck = Torso["Neck"] | |
182 | RightShoulder = Torso["Right Shoulder"] | |
183 | LeftShoulder = Torso["Left Shoulder"] | |
184 | RightHip = Torso["Right Hip"] | |
185 | LeftHip = Torso["Left Hip"] | |
186 | ||
187 | IT = Instance.new | |
188 | CF = CFrame.new | |
189 | VT = Vector3.new | |
190 | RAD = math.rad | |
191 | C3 = Color3.new | |
192 | UD2 = UDim2.new | |
193 | BRICKC = BrickColor.new | |
194 | ANGLES = CFrame.Angles | |
195 | EULER = CFrame.fromEulerAnglesXYZ | |
196 | COS = math.cos | |
197 | ACOS = math.acos | |
198 | SIN = math.sin | |
199 | ASIN = math.asin | |
200 | ABS = math.abs | |
201 | MRANDOM = math.random | |
202 | FLOOR = math.floor | |
203 | ||
204 | --//=================================\\ | |
205 | --|| USEFUL VALUES | |
206 | --\\=================================// | |
207 | ||
208 | Animation_Speed = 3 | |
209 | Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60) | |
210 | local Speed = 16 | |
211 | local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
212 | local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
213 | local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) | |
214 | local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) | |
215 | local DAMAGEMULTIPLIER = 1 | |
216 | local ANIM = "Idle" | |
217 | local ATTACK = false | |
218 | local EQUIPPED = false | |
219 | local HOLD = false | |
220 | local COMBO = 1 | |
221 | local Rooted = false | |
222 | local SINE = 0 | |
223 | local KEYHOLD = false | |
224 | local CHANGE = 2 / Animation_Speed | |
225 | local WALKINGANIM = false | |
226 | local VALUE1 = false | |
227 | local VALUE2 = false | |
228 | local ROBLOXIDLEANIMATION = IT("Animation") | |
229 | ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation" | |
230 | ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571" | |
231 | --ROBLOXIDLEANIMATION.Parent = Humanoid | |
232 | local WEAPONGUI = IT("ScreenGui", PlayerGui) | |
233 | WEAPONGUI.Name = "Weapon GUI" | |
234 | local Effects = IT("Folder", Character) | |
235 | Effects.Name = "Effects" | |
236 | local ANIMATOR = Humanoid.Animator | |
237 | local ANIMATE = Character.Animate | |
238 | local UNANCHOR = true | |
239 | local CUSTOMANGLES = true | |
240 | ||
241 | --//=================================\\ | |
242 | --\\=================================// | |
243 | ||
244 | ||
245 | --//=================================\\ | |
246 | --|| SAZERENOS' ARTIFICIAL HEARTBEAT | |
247 | --\\=================================// | |
248 | ||
249 | ArtificialHB = Instance.new("BindableEvent", script) | |
250 | ArtificialHB.Name = "ArtificialHB" | |
251 | ||
252 | script:WaitForChild("ArtificialHB") | |
253 | ||
254 | frame = Frame_Speed | |
255 | tf = 0 | |
256 | allowframeloss = false | |
257 | tossremainder = false | |
258 | lastframe = tick() | |
259 | script.ArtificialHB:Fire() | |
260 | ||
261 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
262 | tf = tf + s | |
263 | if tf >= frame then | |
264 | if allowframeloss then | |
265 | ArtificialHB:Fire() | |
266 | lastframe = tick() | |
267 | else | |
268 | for i = 1, math.floor(tf / frame) do | |
269 | ArtificialHB:Fire() | |
270 | end | |
271 | lastframe = tick() | |
272 | end | |
273 | if tossremainder then | |
274 | tf = 0 | |
275 | else | |
276 | tf = tf - frame * math.floor(tf / frame) | |
277 | end | |
278 | end | |
279 | end) | |
280 | ||
281 | --//=================================\\ | |
282 | --\\=================================// | |
283 | ||
284 | --//=================================\\ | |
285 | --|| SOME FUNCTIONS | |
286 | --\\=================================// | |
287 | ||
288 | function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS) | |
289 | return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS) | |
290 | end | |
291 | ||
292 | function PositiveAngle(NUMBER) | |
293 | if NUMBER >= 0 then | |
294 | NUMBER = 0 | |
295 | end | |
296 | return NUMBER | |
297 | end | |
298 | ||
299 | function NegativeAngle(NUMBER) | |
300 | if NUMBER <= 0 then | |
301 | NUMBER = 0 | |
302 | end | |
303 | return NUMBER | |
304 | end | |
305 | ||
306 | function Swait(NUMBER) | |
307 | if NUMBER == 0 or NUMBER == nil then | |
308 | ArtificialHB.Event:wait() | |
309 | else | |
310 | for i = 1, NUMBER do | |
311 | ArtificialHB.Event:wait() | |
312 | end | |
313 | end | |
314 | end | |
315 | ||
316 | function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET) | |
317 | local NEWMESH = IT(MESH) | |
318 | if MESH == "SpecialMesh" then | |
319 | NEWMESH.MeshType = MESHTYPE | |
320 | if MESHID ~= "nil" and MESHID ~= "" then | |
321 | NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID | |
322 | end | |
323 | if TEXTUREID ~= "nil" and TEXTUREID ~= "" then | |
324 | NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID | |
325 | end | |
326 | end | |
327 | NEWMESH.Offset = OFFSET or VT(0, 0, 0) | |
328 | NEWMESH.Scale = SCALE | |
329 | NEWMESH.Parent = PARENT | |
330 | return NEWMESH | |
331 | end | |
332 | ||
333 | function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR) | |
334 | local NEWPART = IT("Part") | |
335 | NEWPART.formFactor = FORMFACTOR | |
336 | NEWPART.Reflectance = REFLECTANCE | |
337 | NEWPART.Transparency = TRANSPARENCY | |
338 | NEWPART.CanCollide = false | |
339 | NEWPART.Locked = true | |
340 | NEWPART.Anchored = true | |
341 | if ANCHOR == false then | |
342 | NEWPART.Anchored = false | |
343 | end | |
344 | NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR)) | |
345 | NEWPART.Name = NAME | |
346 | NEWPART.Size = SIZE | |
347 | NEWPART.Position = Torso.Position | |
348 | NEWPART.Material = MATERIAL | |
349 | NEWPART:BreakJoints() | |
350 | NEWPART.Parent = PARENT | |
351 | return NEWPART | |
352 | end | |
353 | ||
354 | local function weldBetween(a, b) | |
355 | local weldd = Instance.new("ManualWeld") | |
356 | weldd.Part0 = a | |
357 | weldd.Part1 = b | |
358 | weldd.C0 = CFrame.new() | |
359 | weldd.C1 = b.CFrame:inverse() * a.CFrame | |
360 | weldd.Parent = a | |
361 | return weldd | |
362 | end | |
363 | ||
364 | ||
365 | function QuaternionFromCFrame(cf) | |
366 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
367 | local trace = m00 + m11 + m22 | |
368 | if trace > 0 then | |
369 | local s = math.sqrt(1 + trace) | |
370 | local recip = 0.5 / s | |
371 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
372 | else | |
373 | local i = 0 | |
374 | if m11 > m00 then | |
375 | i = 1 | |
376 | end | |
377 | if m22 > (i == 0 and m00 or m11) then | |
378 | i = 2 | |
379 | end | |
380 | if i == 0 then | |
381 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
382 | local recip = 0.5 / s | |
383 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
384 | elseif i == 1 then | |
385 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
386 | local recip = 0.5 / s | |
387 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
388 | elseif i == 2 then | |
389 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
390 | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
391 | end | |
392 | end | |
393 | end | |
394 | ||
395 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
396 | local xs, ys, zs = x + x, y + y, z + z | |
397 | local wx, wy, wz = w * xs, w * ys, w * zs | |
398 | local xx = x * xs | |
399 | local xy = x * ys | |
400 | local xz = x * zs | |
401 | local yy = y * ys | |
402 | local yz = y * zs | |
403 | local zz = z * zs | |
404 | 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)) | |
405 | end | |
406 | ||
407 | function QuaternionSlerp(a, b, t) | |
408 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
409 | local startInterp, finishInterp; | |
410 | if cosTheta >= 0.0001 then | |
411 | if (1 - cosTheta) > 0.0001 then | |
412 | local theta = ACOS(cosTheta) | |
413 | local invSinTheta = 1 / SIN(theta) | |
414 | startInterp = SIN((1 - t) * theta) * invSinTheta | |
415 | finishInterp = SIN(t * theta) * invSinTheta | |
416 | else | |
417 | startInterp = 1 - t | |
418 | finishInterp = t | |
419 | end | |
420 | else | |
421 | if (1 + cosTheta) > 0.0001 then | |
422 | local theta = ACOS(-cosTheta) | |
423 | local invSinTheta = 1 / SIN(theta) | |
424 | startInterp = SIN((t - 1) * theta) * invSinTheta | |
425 | finishInterp = SIN(t * theta) * invSinTheta | |
426 | else | |
427 | startInterp = t - 1 | |
428 | finishInterp = t | |
429 | end | |
430 | end | |
431 | 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 | |
432 | end | |
433 | ||
434 | function Clerp(a, b, t) | |
435 | local qa = {QuaternionFromCFrame(a)} | |
436 | local qb = {QuaternionFromCFrame(b)} | |
437 | local ax, ay, az = a.x, a.y, a.z | |
438 | local bx, by, bz = b.x, b.y, b.z | |
439 | local _t = 1 - t | |
440 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
441 | end | |
442 | ||
443 | function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME) | |
444 | local frame = IT("Frame") | |
445 | frame.BackgroundTransparency = TRANSPARENCY | |
446 | frame.BorderSizePixel = BORDERSIZEPIXEL | |
447 | frame.Position = POSITION | |
448 | frame.Size = SIZE | |
449 | frame.BackgroundColor3 = COLOR | |
450 | frame.BorderColor3 = BORDERCOLOR | |
451 | frame.Name = NAME | |
452 | frame.Parent = PARENT | |
453 | return frame | |
454 | end | |
455 | ||
456 | function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME) | |
457 | local label = IT("TextLabel") | |
458 | label.BackgroundTransparency = 1 | |
459 | label.Size = UD2(1, 0, 1, 0) | |
460 | label.Position = UD2(0, 0, 0, 0) | |
461 | label.TextColor3 = TEXTCOLOR | |
462 | label.TextStrokeTransparency = STROKETRANSPARENCY | |
463 | label.TextTransparency = TRANSPARENCY | |
464 | label.FontSize = TEXTFONTSIZE | |
465 | label.Font = TEXTFONT | |
466 | label.BorderSizePixel = BORDERSIZEPIXEL | |
467 | label.TextScaled = false | |
468 | label.Text = TEXT | |
469 | label.Name = NAME | |
470 | label.Parent = PARENT | |
471 | return label | |
472 | end | |
473 | ||
474 | function NoOutlines(PART) | |
475 | PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10 | |
476 | end | |
477 | ||
478 | function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1) | |
479 | local NEWWELD = IT(TYPE) | |
480 | NEWWELD.Part0 = PART0 | |
481 | NEWWELD.Part1 = PART1 | |
482 | NEWWELD.C0 = C0 | |
483 | NEWWELD.C1 = C1 | |
484 | NEWWELD.Parent = PARENT | |
485 | return NEWWELD | |
486 | end | |
487 | ||
488 | local S = IT("Sound") | |
489 | function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP) | |
490 | local NEWSOUND = nil | |
491 | coroutine.resume(coroutine.create(function() | |
492 | NEWSOUND = S:Clone() | |
493 | NEWSOUND.Parent = PARENT | |
494 | NEWSOUND.Volume = VOLUME | |
495 | NEWSOUND.Pitch = PITCH | |
496 | NEWSOUND.SoundId = "rbxassetid://"..ID | |
497 | NEWSOUND:play() | |
498 | if DOESLOOP == true then | |
499 | NEWSOUND.Looped = true | |
500 | else | |
501 | repeat wait(1) until NEWSOUND.Playing == false | |
502 | NEWSOUND:remove() | |
503 | end | |
504 | end)) | |
505 | return NEWSOUND | |
506 | end | |
507 | ||
508 | function CFrameFromTopBack(at, top, back) | |
509 | local right = top:Cross(back) | |
510 | return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z) | |
511 | end | |
512 | ||
513 | --WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
514 | function WACKYEFFECT(Table) | |
515 | local TYPE = (Table.EffectType or "Sphere") | |
516 | local SIZE = (Table.Size or VT(1,1,1)) | |
517 | local ENDSIZE = (Table.Size2 or VT(0,0,0)) | |
518 | local TRANSPARENCY = (Table.Transparency or 0) | |
519 | local ENDTRANSPARENCY = (Table.Transparency2 or 1) | |
520 | local CFRAME = (Table.CFrame or Torso.CFrame) | |
521 | local MOVEDIRECTION = (Table.MoveToPos or nil) | |
522 | local ROTATION1 = (Table.RotationX or 0) | |
523 | local ROTATION2 = (Table.RotationY or 0) | |
524 | local ROTATION3 = (Table.RotationZ or 0) | |
525 | local MATERIAL = (Table.Material or "Neon") | |
526 | local COLOR = (Table.Color or C3(1,1,1)) | |
527 | local TIME = (Table.Time or 45) | |
528 | local SOUNDID = (Table.SoundID or nil) | |
529 | local SOUNDPITCH = (Table.SoundPitch or nil) | |
530 | local SOUNDVOLUME = (Table.SoundVolume or nil) | |
531 | local USEBOOMERANGMATH = (Table.UseBoomerangMath or false) | |
532 | local BOOMERANG = (Table.Boomerang or 0) | |
533 | local SIZEBOOMERANG = (Table.SizeBoomerang or 0) | |
534 | coroutine.resume(coroutine.create(function() | |
535 | local PLAYSSOUND = false | |
536 | local SOUND = nil | |
537 | local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true) | |
538 | if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then | |
539 | PLAYSSOUND = true | |
540 | SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false) | |
541 | end | |
542 | EFFECT.Color = COLOR | |
543 | local MSH = nil | |
544 | if TYPE == "Sphere" then | |
545 | MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0)) | |
546 | elseif TYPE == "Block" or TYPE == "Box" then | |
547 | MSH = IT("BlockMesh",EFFECT) | |
548 | MSH.Scale = SIZE | |
549 | elseif TYPE == "Wave" then | |
550 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8)) | |
551 | elseif TYPE == "Ring" then | |
552 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0)) | |
553 | elseif TYPE == "Slash" then | |
554 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
555 | elseif TYPE == "Round Slash" then | |
556 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
557 | elseif TYPE == "Swirl" then | |
558 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "168892432", "", SIZE, VT(0,0,0)) | |
559 | elseif TYPE == "Skull" then | |
560 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0)) | |
561 | elseif TYPE == "Crystal" then | |
562 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0)) | |
563 | end | |
564 | if MSH ~= nil then | |
565 | local BOOMR1 = 1+BOOMERANG/50 | |
566 | local BOOMR2 = 1+SIZEBOOMERANG/50 | |
567 | local MOVESPEED = nil | |
568 | if MOVEDIRECTION ~= nil then | |
569 | if USEBOOMERANGMATH == true then | |
570 | MOVESPEED = ((CFRAME.p - MOVEDIRECTION).Magnitude/TIME)*BOOMR1 | |
571 | else | |
572 | MOVESPEED = ((CFRAME.p - MOVEDIRECTION).Magnitude/TIME) | |
573 | end | |
574 | end | |
575 | local GROWTH = nil | |
576 | if USEBOOMERANGMATH == true then | |
577 | GROWTH = (SIZE - ENDSIZE)*(BOOMR2+1) | |
578 | else | |
579 | GROWTH = (SIZE - ENDSIZE) | |
580 | end | |
581 | local TRANS = TRANSPARENCY - ENDTRANSPARENCY | |
582 | if TYPE == "Block" then | |
583 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
584 | else | |
585 | EFFECT.CFrame = CFRAME | |
586 | end | |
587 | if USEBOOMERANGMATH == true then | |
588 | for LOOP = 1, TIME+1 do | |
589 | Swait() | |
590 | MSH.Scale = MSH.Scale - (VT((GROWTH.X)*((1 - (LOOP/TIME)*BOOMR2)),(GROWTH.Y)*((1 - (LOOP/TIME)*BOOMR2)),(GROWTH.Z)*((1 - (LOOP/TIME)*BOOMR2)))*BOOMR2)/TIME | |
591 | if TYPE == "Wave" then | |
592 | MSH.Offset = VT(0,0,-MSH.Scale.Z/8) | |
593 | end | |
594 | EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME | |
595 | if TYPE == "Block" then | |
596 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
597 | else | |
598 | EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3)) | |
599 | end | |
600 | if MOVEDIRECTION ~= nil then | |
601 | local ORI = EFFECT.Orientation | |
602 | EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-(MOVESPEED)*((1 - (LOOP/TIME)*BOOMR1))) | |
603 | EFFECT.CFrame = CF(EFFECT.Position)*ANGLES(RAD(ORI.X),RAD(ORI.Y),RAD(ORI.Z)) | |
604 | end | |
605 | end | |
606 | else | |
607 | for LOOP = 1, TIME+1 do | |
608 | Swait() | |
609 | MSH.Scale = MSH.Scale - GROWTH/TIME | |
610 | if TYPE == "Wave" then | |
611 | MSH.Offset = VT(0,0,-MSH.Scale.Z/8) | |
612 | end | |
613 | EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME | |
614 | if TYPE == "Block" then | |
615 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
616 | else | |
617 | EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3)) | |
618 | end | |
619 | if MOVEDIRECTION ~= nil then | |
620 | local ORI = EFFECT.Orientation | |
621 | EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED) | |
622 | EFFECT.CFrame = CF(EFFECT.Position)*ANGLES(RAD(ORI.X),RAD(ORI.Y),RAD(ORI.Z)) | |
623 | end | |
624 | end | |
625 | end | |
626 | EFFECT.Transparency = 1 | |
627 | if PLAYSSOUND == false then | |
628 | EFFECT:remove() | |
629 | else | |
630 | repeat Swait() until EFFECT:FindFirstChildOfClass("Sound") == nil | |
631 | EFFECT:remove() | |
632 | end | |
633 | else | |
634 | if PLAYSSOUND == false then | |
635 | EFFECT:remove() | |
636 | else | |
637 | repeat Swait() until EFFECT:FindFirstChildOfClass("Sound") == nil | |
638 | EFFECT:remove() | |
639 | end | |
640 | end | |
641 | end)) | |
642 | end | |
643 | ||
644 | function MakeForm(PART,TYPE) | |
645 | if TYPE == "Cyl" then | |
646 | local MSH = IT("CylinderMesh",PART) | |
647 | elseif TYPE == "Ball" then | |
648 | local MSH = IT("SpecialMesh",PART) | |
649 | MSH.MeshType = "Sphere" | |
650 | elseif TYPE == "Wedge" then | |
651 | local MSH = IT("SpecialMesh",PART) | |
652 | MSH.MeshType = "Wedge" | |
653 | end | |
654 | end | |
655 | ||
656 | Debris = game:GetService("Debris") | |
657 | ||
658 | function CastProperRay(StartPos, EndPos, Distance, Ignore) | |
659 | local DIRECTION = CF(StartPos,EndPos).lookVector | |
660 | local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore}) | |
661 | return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, DIRECTION * Distance), Ignore) | |
662 | end | |
663 | ||
664 | local Particle = IT("ParticleEmitter",nil) | |
665 | Particle.Enabled = false | |
666 | Particle.LightEmission = 0.8 | |
667 | Particle.Rate = 150 | |
668 | Particle.ZOffset = 1 | |
669 | Particle.Rotation = NumberRange.new(-180, 180) | |
670 | ||
671 | --ParticleEmitter({Speed = 2, RotSpeed = NumberRange.new(-5, 5), Drag = 0, Size1 = 1, Size2 = 0, Lifetime1 = 1, Lifetime2 = 0, Parent = Torso, Emit = 10, Offset = 360, Enabled = false, Color1 = C3(1,1,1), Color2 = C3(1,1,1), Texture = ""}) | |
672 | function ParticleEmitter(Table) | |
673 | local PRTCL = Particle:Clone() | |
674 | local Color1 = Table.Color1 or C3(1,1,1) | |
675 | local Color2 = Table.Color2 or C3(1,1,1) | |
676 | local Speed = Table.Speed or 5 | |
677 | local Drag = Table.Drag or 0 | |
678 | local Size1 = Table.Size1 or 1 | |
679 | local Size2 = Table.Size2 or 5 | |
680 | local Lifetime1 = Table.Lifetime1 or 1 | |
681 | local Lifetime2 = Table.Lifetime2 or 1.5 | |
682 | local Parent = Table.Parent or Torso | |
683 | local Emit = Table.Emit or 100 | |
684 | local Offset = Table.Offset or 360 | |
685 | local Acel = Table.Acel or VT(0,0,0) | |
686 | local Enabled = Table.Enabled or false | |
687 | local Texture = Table.Texture or "281983280" | |
688 | local RotS = Table.RotSpeed or NumberRange.new(-15, 15) | |
689 | local Trans1 = Table.Transparency1 or 0 | |
690 | local Trans2 = Table.Transparency2 or 0 | |
691 | PRTCL.Parent = Parent | |
692 | PRTCL.RotSpeed = RotS | |
693 | PRTCL.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,Trans1),NumberSequenceKeypoint.new(1,Trans2)}) | |
694 | PRTCL.Texture = "http://www.roblox.com/asset/?id="..Texture | |
695 | PRTCL.Color = ColorSequence.new(Color1,Color2) | |
696 | PRTCL.Size = NumberSequence.new(Size1,Size2) | |
697 | PRTCL.Lifetime = NumberRange.new(Lifetime1,Lifetime2) | |
698 | PRTCL.Speed = NumberRange.new(Speed) | |
699 | PRTCL.VelocitySpread = Offset | |
700 | PRTCL.Drag = Drag | |
701 | PRTCL.Acceleration = Acel | |
702 | if Enabled == false then | |
703 | PRTCL:Emit(Emit) | |
704 | Debris:AddItem(PRTCL,Lifetime2) | |
705 | else | |
706 | PRTCL.Enabled = true | |
707 | end | |
708 | return PRTCL | |
709 | end | |
710 | ||
711 | function AttackGyro() | |
712 | local GYRO = IT("BodyGyro",RootPart) | |
713 | GYRO.D = 15 | |
714 | GYRO.P = 200000 | |
715 | GYRO.MaxTorque = VT(0,4000000,0) | |
716 | GYRO.CFrame = CF(RootPart.Position,Mouse.Hit.p) | |
717 | coroutine.resume(coroutine.create(function() | |
718 | repeat | |
719 | Swait() | |
720 | GYRO.CFrame = CF(RootPart.Position,Mouse.Hit.p) | |
721 | until ATTACK == false | |
722 | GYRO:Remove() | |
723 | end)) | |
724 | end | |
725 | ||
726 | --//=================================\\ | |
727 | --|| GUIS AND MISC | |
728 | --\\=================================// | |
729 | ||
730 | local CAMTYPE = Cam.CameraType | |
731 | Cam.CameraType = Enum.CameraType.Scriptable | |
732 | ||
733 | local ATTACKS = {2035463713,2035463980,2035464212,2035464495} | |
734 | ||
735 | local BMUSIC = IT("Sound",RootPart) | |
736 | local VOLUME = 4.5 | |
737 | local PITCH = 1.15 | |
738 | local SONGID = 904882921 | |
739 | local INTROD = false | |
740 | local SUN = CreatePart(3, nil, "Neon", 0, 0, BRICKC("New Yeller"), "Sun", VT(17,17,17), true) | |
741 | MakeForm(SUN,"Ball") | |
742 | local SUNFLOAT = true | |
743 | local CUSTOMCAM = true | |
744 | ||
745 | --//=================================\\ | |
746 | --|| DAMAGING | |
747 | --\\=================================// | |
748 | ||
749 | function ApplyAoE(POSITION,RANGE,FLING,KILLME) | |
750 | for index, CHILD in pairs(workspace:GetDescendants()) do | |
751 | if CHILD.ClassName == "Model" and CHILD ~= Character then | |
752 | local HUM = CHILD:FindFirstChildOfClass("Humanoid") | |
753 | if HUM then | |
754 | local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso") | |
755 | if TORSO and HUM.Health > 0 then | |
756 | if (TORSO.Position - POSITION).Magnitude <= RANGE then | |
757 | CHILD:BreakJoints() | |
758 | local HED = CHILD:FindFirstChild("Head") | |
759 | if HED and MRANDOM(1,15) == 1 then | |
760 | CreateSound(527749592, HED, 4, MRANDOM(9,11)/10, false) | |
761 | end | |
762 | if FLING > 0 then | |
763 | for _, c in pairs(CHILD:GetChildren()) do | |
764 | if c:IsA("BasePart") then | |
765 | local bv = Instance.new("BodyVelocity") | |
766 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
767 | bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING | |
768 | bv.Parent = c | |
769 | Debris:AddItem(bv,0.05) | |
770 | end | |
771 | end | |
772 | end | |
773 | end | |
774 | end | |
775 | end | |
776 | end | |
777 | end | |
778 | if KILLME == true then | |
779 | Character:BreakJoints() | |
780 | for _, c in pairs(Character:GetChildren()) do | |
781 | if c:IsA("BasePart") then | |
782 | local bv = Instance.new("BodyVelocity") | |
783 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
784 | bv.velocity = CF(POSITION,c.Position).lookVector*FLING | |
785 | bv.Parent = c | |
786 | Debris:AddItem(bv,0.05) | |
787 | end | |
788 | end | |
789 | end | |
790 | end | |
791 | ||
792 | --//=================================\\ | |
793 | --|| ATTACK FUNCTIONS AND STUFF | |
794 | --\\=================================// | |
795 | ||
796 | function Intro() | |
797 | ATTACK = true | |
798 | Rooted = true | |
799 | Humanoid.WalkSpeed = 0 | |
800 | Disable_Jump = true | |
801 | local INTROSOUND = CreateSound(862484466, Effects, 6, 1, false) | |
802 | coroutine.resume(coroutine.create(function() | |
803 | repeat | |
804 | Swait() | |
805 | if CUSTOMANGLES == true then | |
806 | Cam.CFrame = Clerp(Cam.CFrame, Head.CFrame * CF(0,0,-4) * ANGLES(RAD(0), RAD(180), RAD(0)), 0.2) | |
807 | end | |
808 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
809 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
810 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(0), RAD(0), RAD(5)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
811 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(0), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
812 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(60), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed) | |
813 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-60), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed) | |
814 | until INTROSOUND.TimePosition >= 2.15 | |
815 | SUN.Parent = Effects | |
816 | local CORE = IT("Attachment",SUN) | |
817 | SUN.Color = C3(1,85/255,0) | |
818 | SUN.CFrame = RootPart.CFrame*CF(0,-14,11) | |
819 | local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871}) | |
820 | P.LockedToPart = true | |
821 | P.Rate = 12 | |
822 | local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871}) | |
823 | P.Rate = 12 | |
824 | repeat | |
825 | Swait() | |
826 | SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,14,11),0.04) | |
827 | local HITFLOOR,SUNPOS = Raycast(SUN.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 23, Character) | |
828 | if HITFLOOR then | |
829 | local DISTANCE = (SUNPOS - SUN.Position).Magnitude | |
830 | local SIZE = (23 - DISTANCE)*2 | |
831 | end | |
832 | if CUSTOMANGLES == true then | |
833 | Cam.CFrame = Clerp(Cam.CFrame, Head.CFrame * CF(0,5,-15) * ANGLES(RAD(5), RAD(180), RAD(0)), 0.2) | |
834 | end | |
835 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
836 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-35 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
837 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
838 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
839 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
840 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
841 | until ATTACK == false | |
842 | CUSTOMCAM = false | |
843 | for i = 1, #ATTACKS do | |
844 | local SKILLFRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.65, 0, 0.95-(0.17*i), 0), UD2(0.26, 0, 0.17, 0), C3(0,0,0), C3(0, 0, 0), "Skill Frame") | |
845 | local IMAGE = IT("ImageLabel",SKILLFRAME) | |
846 | IMAGE.Size = UD2(1,0,1,0) | |
847 | IMAGE.Image = "rbxassetid://"..ATTACKS[i] | |
848 | IMAGE.BackgroundTransparency = 1 | |
849 | IMAGE.ImageTransparency = 1 | |
850 | for i = 1, 10 do | |
851 | Swait() | |
852 | IMAGE.ImageTransparency = IMAGE.ImageTransparency - 1/10 | |
853 | end | |
854 | end | |
855 | end)) | |
856 | repeat | |
857 | Swait() | |
858 | INTROSOUND.Parent = Effects | |
859 | until INTROSOUND.Playing == false | |
860 | INTROSOUND:Destroy() | |
861 | ATTACK = false | |
862 | Rooted = false | |
863 | end | |
864 | function DeadlyLaser() | |
865 | CreateSound(811841430, SUN, 8, MRANDOM(7,13)/10, false) | |
866 | local HIT,POS = CastProperRay(SUN.Position,Mouse.Hit.p,1000,Character) | |
867 | local BEAM = CreatePart(3, Effects, "Neon", 0, 0, BRICKC("Gold"), "Beam", VT(0,0,0), true) | |
868 | BEAM.Color = SUN.Color | |
869 | MakeForm(BEAM,"Cyl") | |
870 | local DIST = (SUN.Position - POS).Magnitude | |
871 | BEAM.Size = VT(0,DIST,0) | |
872 | BEAM.CFrame = CF(SUN.Position,POS)*CF(0,0,-DIST/2) * ANGLES(RAD(90), RAD(0), RAD(0)) | |
873 | if HIT ~= nil then | |
874 | if HIT.Parent.ClassName == "Model" then | |
875 | if HIT.Parent:FindFirstChildOfClass("Humanoid") then | |
876 | if HIT.Parent:FindFirstChildOfClass("Humanoid").Health > 0 then | |
877 | local HED = HIT.Parent:FindFirstChild("Head") | |
878 | if HED and MRANDOM(1,15) == 1 then | |
879 | CreateSound(527749592, HED, 4, MRANDOM(9,11)/10, false) | |
880 | end | |
881 | HIT.Parent:BreakJoints() | |
882 | end | |
883 | end | |
884 | end | |
885 | end | |
886 | for i = 1, 15 do | |
887 | Swait() | |
888 | BEAM.Size = BEAM.Size + VT(0.25,0,0.25) | |
889 | BEAM.Transparency = BEAM.Transparency + 1/15 | |
890 | end | |
891 | BEAM:remove() | |
892 | end | |
893 | function SolarFlares() | |
894 | ATTACK = true | |
895 | Rooted = true | |
896 | SUNFLOAT = false | |
897 | CUSTOMCAM = true | |
898 | for i=0, 1, 0.1 / Animation_Speed do | |
899 | Swait() | |
900 | if CUSTOMANGLES == true then | |
901 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-45), RAD(0), RAD(0))*CF(0,0,65), 0.1) | |
902 | end | |
903 | SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,18 + 4 * SIN(SINE / 12),0),0.035) | |
904 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
905 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-35 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
906 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
907 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
908 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
909 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
910 | end | |
911 | local CFRAME = RootPart.CFrame * ANGLES(RAD(-90), RAD(0), RAD(0))*CF(0,0,125) | |
912 | coroutine.resume(coroutine.create(function() | |
913 | repeat | |
914 | Swait() | |
915 | if CUSTOMANGLES == true then | |
916 | Cam.CFrame = Clerp(Cam.CFrame, CFRAME, 0.1) | |
917 | end | |
918 | SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,18 + 4 * SIN(SINE / 12),0),0.035) | |
919 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
920 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
921 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(90), RAD(0), RAD(-15)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
922 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(90), RAD(0), RAD(15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
923 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
924 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
925 | until ATTACK == false | |
926 | end)) | |
927 | AttackGyro() | |
928 | wait(0.2) | |
929 | for i = 1, 15 do | |
930 | Swait() | |
931 | coroutine.resume(coroutine.create(function() | |
932 | local SPEED = MRANDOM(5,32)/10 | |
933 | local FLARE = CreatePart(3, Effects, "Neon", 0, 0, SUN.BrickColor, "Sun", VT(5,5,5), true) | |
934 | FLARE.Color = C3(1,85/255,0) | |
935 | MakeForm(FLARE,"Ball") | |
936 | CreateSound(463598785, FLARE, 1.2, MRANDOM(7,13)/8, false) | |
937 | FLARE.CFrame = CF(SUN.Position,Mouse.Hit.p) * ANGLES(RAD(MRANDOM(-5,5)*2), RAD(MRANDOM(-5,5)*2), RAD(0)) | |
938 | local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871}) | |
939 | for i = 1, 500 do | |
940 | Swait() | |
941 | P.Enabled = true | |
942 | local HIT,HITPOS = Raycast(FLARE.Position, FLARE.CFrame.lookVector, FLARE.Size.Z/2, Character) | |
943 | if HIT then | |
944 | break | |
945 | else | |
946 | FLARE.CFrame = FLARE.CFrame*CF(0,0,-SPEED) | |
947 | if MRANDOM(1,3) == 1 then | |
948 | WACKYEFFECT({Time = 25, EffectType = "Round Slash", Size = VT(0,0,0), Size2 = VT(0.025,0,0.025), Transparency = 0.85, Transparency2 = 1, CFrame = FLARE.CFrame*CF(0,0,-FLARE.Size.X/1.5) * ANGLES(RAD(90), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 0.1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 45}) | |
949 | end | |
950 | end | |
951 | end | |
952 | CreateSound(165970126, FLARE, 0.8, MRANDOM(7,13)/8, false) | |
953 | CreateSound(174580476, FLARE, 1.6, MRANDOM(7,13)/10, false) | |
954 | P.Enabled = false | |
955 | ApplyAoE(FLARE.Position,14,125) | |
956 | Debris:AddItem(FLARE,5) | |
957 | FLARE.Transparency = 1 | |
958 | WACKYEFFECT({EffectType = "Sphere", Size = FLARE.Size, Size2 = VT(25,25,25), Transparency = 0, Transparency2 = 1, CFrame = CF(FLARE.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = FLARE.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
959 | ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871}) | |
960 | end)) | |
961 | end | |
962 | wait(0.1) | |
963 | CUSTOMCAM = false | |
964 | SUNFLOAT = true | |
965 | ATTACK = false | |
966 | Rooted = false | |
967 | end | |
968 | function SolarSmash() | |
969 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
970 | if HITFLOOR then | |
971 | ATTACK = true | |
972 | Rooted = false | |
973 | CUSTOMCAM = true | |
974 | SUNFLOAT = false | |
975 | for i=0, 0.2, 0.1 / Animation_Speed do | |
976 | Swait() | |
977 | if CUSTOMANGLES == true then | |
978 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-45), RAD(0), RAD(0))*CF(0,0,65), 0.1) | |
979 | end | |
980 | SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,18 + 4 * SIN(SINE / 12),6),0.035) | |
981 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
982 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-35 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
983 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
984 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
985 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
986 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
987 | end | |
988 | coroutine.resume(coroutine.create(function() | |
989 | repeat | |
990 | Swait() | |
991 | if CUSTOMANGLES == true then | |
992 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-75), RAD(0), RAD(0))*CF(0,6,65), 0.1) | |
993 | end | |
994 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
995 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
996 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(35), RAD(0), RAD(-15)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
997 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(35), RAD(0), RAD(15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
998 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
999 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1000 | until ATTACK == false | |
1001 | end)) | |
1002 | local CFRAME = RootPart.CFrame*CF(0,-2,-17) | |
1003 | for i = 1, 10 do | |
1004 | Swait() | |
1005 | SUN.CFrame = Clerp(SUN.CFrame,CFRAME, 0.25) | |
1006 | end | |
1007 | ApplyAoE(SUN.Position,65,225) | |
1008 | ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871}) | |
1009 | for i = 1, 8 do | |
1010 | WACKYEFFECT({Time = 30+(i*25), EffectType = "Wave", Size = VT(15,0,15), Size2 = VT(120,0,120), Transparency = 0.6, Transparency2 = 1, CFrame = CF(SUN.Position-VT(0,5,0)) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 0.1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 22}) | |
1011 | end | |
1012 | for i = 1, 5 do | |
1013 | WACKYEFFECT({Time = 50+(i*25), EffectType = "Round Slash", Size = VT(0,0,0), Size2 = VT(1.5,0,1.5), Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position-VT(0,5,0)) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 0.1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 3}) | |
1014 | end | |
1015 | WACKYEFFECT({Time = 75, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*6, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 168513088, SoundPitch = 1, SoundVolume = 5, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 3}) | |
1016 | WACKYEFFECT({Time = 65, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*5.5, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 201858144, SoundPitch = 1, SoundVolume = 3, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1017 | local bv = Instance.new("BodyVelocity") | |
1018 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
1019 | bv.velocity = CF(CFRAME.p-VT(0,12,0),RootPart.Position).lookVector*125 | |
1020 | bv.Parent = RootPart | |
1021 | Debris:AddItem(bv,0.02) | |
1022 | CUSTOMCAM = false | |
1023 | for i = 1, 5 do | |
1024 | Swait() | |
1025 | SUN.CFrame = Clerp(SUN.CFrame,CFRAME, 0.1) | |
1026 | end | |
1027 | SUNFLOAT = true | |
1028 | ATTACK = false | |
1029 | Rooted = false | |
1030 | end | |
1031 | end | |
1032 | function SolarEruption() | |
1033 | ATTACK = true | |
1034 | Rooted = true | |
1035 | CUSTOMCAM = true | |
1036 | local ANIMA = "HoldUp" | |
1037 | coroutine.resume(coroutine.create(function() | |
1038 | repeat | |
1039 | Swait() | |
1040 | if ANIMA == "HoldUp" then | |
1041 | if CUSTOMANGLES == true then | |
1042 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-45), RAD(0), RAD(0))*CF(0,0,65), 0.1) | |
1043 | end | |
1044 | SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,28 + 4 * SIN(SINE / 12),6),0.035) | |
1045 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1046 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1047 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1, 0.85 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(160 + 3 * SIN(SINE / 12)), RAD(5), RAD(-15 + 3 * COS(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1048 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1049 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(70), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1050 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-70), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1051 | elseif ANIMA == "Fire" then | |
1052 | if CUSTOMANGLES == true then | |
1053 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * CF(0,135,0) * ANGLES(RAD(-90), RAD(0), RAD(0)), 0.2) | |
1054 | end | |
1055 | SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,35,0),0.2) | |
1056 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1057 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-25 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1058 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.65 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(170), RAD(5), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1059 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.65 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(170), RAD(-5), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1060 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(-25), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1061 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(-25), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1062 | end | |
1063 | until ATTACK == false | |
1064 | end)) | |
1065 | CreateSound(201858045, SUN, 1.8, MRANDOM(7,13)/10, false) | |
1066 | CreateSound(278641993, SUN, 3, MRANDOM(7,13)/10, false) | |
1067 | CreateSound(278641993, SUN, 2.5, MRANDOM(7,13)/10, false) | |
1068 | for i = 1, 150 do | |
1069 | Swait() | |
1070 | WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(85,0,85), Size2 = VT(0,0,0), Transparency = 1, Transparency2 = 0.8, CFrame = CF(SUN.Position)*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1071 | WACKYEFFECT({Time = 15, EffectType = "Sphere", Size = VT(45,45,45), Size2 = VT(0,0,0), Transparency = 0.95, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1072 | end | |
1073 | wait(0.1) | |
1074 | UNANCHOR = false | |
1075 | ANIMA = "Fire" | |
1076 | wait(0.4) | |
1077 | ApplyAoE(SUN.Position,25,75) | |
1078 | WACKYEFFECT({Time = 45, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*4, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = 1, SoundVolume = 5, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 3}) | |
1079 | WACKYEFFECT({Time = 35, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*3.5, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 401056199, SoundPitch = 1, SoundVolume = 7, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1080 | coroutine.resume(coroutine.create(function() | |
1081 | for i = 1, 32 do | |
1082 | Swait() | |
1083 | coroutine.resume(coroutine.create(function() | |
1084 | local FLARE = CreatePart(3, Effects, "Neon", 0, 0, SUN.BrickColor, "Sun", VT(5,5,5), false) | |
1085 | FLARE.CanCollide = true | |
1086 | FLARE.Color = C3(1,85/255,0) | |
1087 | MakeForm(FLARE,"Ball") | |
1088 | Debris:AddItem(FLARE,10) | |
1089 | CreateSound(463598785, FLARE, 1.2, MRANDOM(7,13)/8, false) | |
1090 | local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871}) | |
1091 | FLARE.CFrame = CF(SUN.Position)*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
1092 | FLARE.Velocity = CF(SUN.Position,CF(SUN.Position)*ANGLES(RAD(0),RAD(MRANDOM(0,360)),RAD(0))*CF(MRANDOM(-60,60),25,MRANDOM(-60,60)).p).lookVector*MRANDOM(25,250) | |
1093 | TOUCH = FLARE.Touched:Connect(function(TOC) | |
1094 | if TOC.Parent ~= Character and TOC.Parent.Parent ~= Character then | |
1095 | FLARE.Anchored = true | |
1096 | FLARE:ClearAllChildren() | |
1097 | CreateSound(165970126, FLARE, 0.8, MRANDOM(7,13)/8, false) | |
1098 | CreateSound(174580476, FLARE, 1.6, MRANDOM(7,13)/10, false) | |
1099 | FLARE.CanCollide = false | |
1100 | ApplyAoE(FLARE.Position,14,125) | |
1101 | FLARE.Transparency = 1 | |
1102 | WACKYEFFECT({EffectType = "Sphere", Size = FLARE.Size, Size2 = VT(25,25,25), Transparency = 0, Transparency2 = 1, CFrame = CF(FLARE.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = FLARE.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1103 | ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871}) | |
1104 | TOUCH:Disconnect() | |
1105 | end | |
1106 | end) | |
1107 | end)) | |
1108 | end | |
1109 | end)) | |
1110 | wait(1.5) | |
1111 | UNANCHOR = true | |
1112 | CUSTOMCAM = false | |
1113 | ATTACK = false | |
1114 | Rooted = false | |
1115 | end | |
1116 | function Nebula() | |
1117 | ATTACK = true | |
1118 | Rooted = false | |
1119 | CUSTOMCAM = true | |
1120 | local DEAD = false | |
1121 | coroutine.resume(coroutine.create(function() | |
1122 | while true do | |
1123 | Swait() | |
1124 | if DEAD == false then | |
1125 | if CUSTOMANGLES == true then | |
1126 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * CF(0,435,0) * ANGLES(RAD(-90), RAD(0), RAD(0)), 0.01) | |
1127 | end | |
1128 | SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,35,0),0.2) | |
1129 | end | |
1130 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1131 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1132 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1, 0.85 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(160), RAD(5), RAD(-15)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1133 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1134 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1135 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1136 | end | |
1137 | end)) | |
1138 | wait(1) | |
1139 | CreateSound(201858045, SUN, 1.8, MRANDOM(7,13)/10, false) | |
1140 | CreateSound(278641993, SUN, 3, MRANDOM(7,13)/10, false) | |
1141 | CreateSound(278641993, SUN, 2.5, MRANDOM(7,13)/10, false) | |
1142 | for i = 1, 250 do | |
1143 | Swait() | |
1144 | WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(2,0,2), Size2 = VT(32,2.5,32), Transparency = 0.75, Transparency2 = 1, CFrame = CF(RootPart.CFrame*CF(0,-4,0).p) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 22}) | |
1145 | WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(85,0,85), Size2 = VT(0,0,0), Transparency = 1, Transparency2 = 0.8, CFrame = CF(SUN.Position)*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1146 | WACKYEFFECT({Time = 15, EffectType = "Sphere", Size = VT(45,45,45), Size2 = VT(0,0,0), Transparency = 0.95, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1147 | end | |
1148 | wait(1) | |
1149 | for i = 1, 3 do | |
1150 | wait(0.65) | |
1151 | WACKYEFFECT({Time = 35, EffectType = "Sphere", Size = SUN.Size, Size2 = VT(250,250,250), Transparency = 0.5, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 852135845, SoundPitch = 1-(i/10), SoundVolume = 5, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1152 | end | |
1153 | wait(0.65) | |
1154 | ApplyAoE(SUN.Position,9999999999999999,125,true) | |
1155 | SUN:ClearAllChildren() | |
1156 | SUN.Transparency = 1 | |
1157 | CreateSound(385545047, Effects, 2.5, 1.4, false) | |
1158 | CreateSound(385545047, Effects, 2.5, 1, false) | |
1159 | CreateSound(435742675, Effects, 2.5, 1.5, false) | |
1160 | CreateSound(231917744, Effects, 2.5, 1.5, false) | |
1161 | CreateSound(401056199, Effects, 2.5, 1, false) | |
1162 | ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 25, Acel = VT(0,0,0), RotSpeed = NumberRange.new(5, 5), Drag = -1, Size1 = 5, Size2 = 6, Lifetime1 = 0.1, Lifetime2 = 1, Parent = SUN, Emit = 20, Offset = 180, Enabled = false, Color1 = C3(1,85/255,0), Color2 = BRICKC"Royal purple".Color, Texture = 296874871}) | |
1163 | for i = 1, 3 do | |
1164 | WACKYEFFECT({Time = 175, EffectType = "Sphere", Size = SUN.Size, Size2 = VT(250,250,250)+(VT(i,i,i)*180), Transparency = 0.5, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = BRICKC"Royal purple".Color, SoundID = nil, SoundPitch = 1-(i/10), SoundVolume = 5, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0}) | |
1165 | end | |
1166 | for i = 1, 15 do | |
1167 | WACKYEFFECT({Time = 100+(i*35), EffectType = "Wave", Size = VT(15,0,15), Size2 = VT(120,5,120)+(VT(i,0,i)*70), Transparency = 0.6, Transparency2 = 1, CFrame = CF(SUN.Position) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = BRICKC"Pink".Color, SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 22}) | |
1168 | end | |
1169 | DEAD = true | |
1170 | Cam.CameraType = CAMTYPE | |
1171 | Cam.CameraSubject = Humanoid | |
1172 | INTROD = false | |
1173 | end | |
1174 | function Taunt() | |
1175 | ATTACK = true | |
1176 | Rooted = true | |
1177 | CUSTOMCAM = true | |
1178 | CreateSound(160212768, Head, 10, 1, false) | |
1179 | for i=0, 3, 0.1 / Animation_Speed do | |
1180 | Swait() | |
1181 | if CUSTOMANGLES == true then | |
1182 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * CF(7,1.5,6) * ANGLES(RAD(-4), RAD(15), RAD(0)), 0.2) | |
1183 | end | |
1184 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-35)), 1 / Animation_Speed) | |
1185 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(35)), 1 / Animation_Speed) | |
1186 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(0.75, 0.5 + 0.05 * SIN(SINE / 12), -0.7) * ANGLES(RAD(0), RAD(0), RAD(-95)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1187 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.3, 0.5 + 0.05 * SIN(SINE / 12), -0.3) * ANGLES(RAD(90), RAD(0), RAD(-35)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1188 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(95), RAD(0)) * ANGLES(RAD(-15), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1189 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-55), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1190 | end | |
1191 | CUSTOMCAM = false | |
1192 | ATTACK = false | |
1193 | Rooted = false | |
1194 | end | |
1195 | ||
1196 | --//=================================\\ | |
1197 | --|| ASSIGN THINGS TO KEYS | |
1198 | --\\=================================// | |
1199 | ||
1200 | function MouseDown(Mouse) | |
1201 | if ATTACK == false then | |
1202 | DeadlyLaser() | |
1203 | end | |
1204 | end | |
1205 | ||
1206 | function MouseUp(Mouse) | |
1207 | HOLD = false | |
1208 | end | |
1209 | ||
1210 | function KeyDown(Key) | |
1211 | KEYHOLD = true | |
1212 | if Key == "z" and ATTACK == false then | |
1213 | SolarFlares() | |
1214 | end | |
1215 | ||
1216 | if Key == "c" and ATTACK == false then | |
1217 | SolarSmash() | |
1218 | end | |
1219 | ||
1220 | if Key == "v" and ATTACK == false then | |
1221 | SolarEruption() | |
1222 | end | |
1223 | ||
1224 | if Key == "x" and ATTACK == false then | |
1225 | Nebula() | |
1226 | end | |
1227 | ||
1228 | if Key == "t" and ATTACK == false then | |
1229 | Taunt() | |
1230 | end | |
1231 | ||
1232 | if Key == "q" and ATTACK == false then | |
1233 | if CUSTOMANGLES == true then | |
1234 | CUSTOMANGLES = false | |
1235 | Cam.CameraSubject = Humanoid | |
1236 | else | |
1237 | CUSTOMANGLES = true | |
1238 | end | |
1239 | end | |
1240 | end | |
1241 | ||
1242 | function KeyUp(Key) | |
1243 | KEYHOLD = false | |
1244 | end | |
1245 | ||
1246 | Mouse.Button1Down:connect(function(NEWKEY) | |
1247 | MouseDown(NEWKEY) | |
1248 | end) | |
1249 | Mouse.Button1Up:connect(function(NEWKEY) | |
1250 | MouseUp(NEWKEY) | |
1251 | end) | |
1252 | Mouse.KeyDown:connect(function(NEWKEY) | |
1253 | KeyDown(NEWKEY) | |
1254 | end) | |
1255 | Mouse.KeyUp:connect(function(NEWKEY) | |
1256 | KeyUp(NEWKEY) | |
1257 | end) | |
1258 | ||
1259 | --//=================================\\ | |
1260 | --\\=================================// | |
1261 | ||
1262 | function unanchor() | |
1263 | for _, c in pairs(Character:GetChildren()) do | |
1264 | if c:IsA("BasePart") and c ~= RootPart then | |
1265 | c.Anchored = false | |
1266 | end | |
1267 | end | |
1268 | if UNANCHOR == true then | |
1269 | RootPart.Anchored = false | |
1270 | else | |
1271 | RootPart.Anchored = true | |
1272 | end | |
1273 | end | |
1274 | ||
1275 | --//=================================\\ | |
1276 | --|| WRAP THE WHOLE SCRIPT UP | |
1277 | --\\=================================// | |
1278 | ||
1279 | Humanoid.Changed:connect(function(Jump) | |
1280 | if Jump == "Jump" and (Disable_Jump == true) then | |
1281 | Humanoid.Jump = false | |
1282 | end | |
1283 | end) | |
1284 | ||
1285 | while true do | |
1286 | Swait() | |
1287 | script.Parent = WEAPONGUI | |
1288 | ANIMATE.Parent = nil | |
1289 | for _,v in next, Humanoid:GetPlayingAnimationTracks() do | |
1290 | v:Stop(); | |
1291 | end | |
1292 | SINE = SINE + CHANGE | |
1293 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
1294 | local TORSOVERTICALVELOCITY = RootPart.Velocity.y | |
1295 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
1296 | local WALKSPEEDVALUE = 8 / (Humanoid.WalkSpeed / 16) | |
1297 | if ANIM == "Walk" and TORSOVELOCITY > 1 then | |
1298 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0.1 * COS(SINE / (WALKSPEEDVALUE/2))) * ANGLES(RAD(0), RAD(0), RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1299 | Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1300 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.25 * SIN(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10+50 * COS(SINE / WALKSPEEDVALUE))), 0.6 / Animation_Speed) | |
1301 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.25 * SIN(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-10+50 * COS(SINE / WALKSPEEDVALUE))), 0.6 / Animation_Speed) | |
1302 | elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then | |
1303 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1304 | Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1305 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.7 / Animation_Speed) | |
1306 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.7 / Animation_Speed) | |
1307 | end | |
1308 | if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then | |
1309 | ANIM = "Jump" | |
1310 | if ATTACK == false then | |
1311 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(-5), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1312 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(-25), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1313 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-35), RAD(0), RAD(25 + 10 * COS(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1314 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-35), RAD(0), RAD(-25 - 10 * COS(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1315 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.4, -0.6) * ANGLES(RAD(1), RAD(90), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1316 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1317 | end | |
1318 | elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then | |
1319 | ANIM = "Fall" | |
1320 | if ATTACK == false then | |
1321 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(15), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1322 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(15), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1323 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(35 - 4 * COS(SINE / 6)), RAD(0), RAD(45 + 10 * COS(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1324 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(35 - 4 * COS(SINE / 6)), RAD(0), RAD(-45 - 10 * COS(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1325 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.3, -0.7) * ANGLES(RAD(-25 + 5 * SIN(SINE / 12)), RAD(90), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1326 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -0.8, -0.3) * ANGLES(RAD(-10), RAD(-80), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1327 | end | |
1328 | elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then | |
1329 | ANIM = "Idle" | |
1330 | if ATTACK == false then | |
1331 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-35)), 1 / Animation_Speed) | |
1332 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(35)), 1 / Animation_Speed) | |
1333 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(0.75, 0.5 + 0.05 * SIN(SINE / 12), -0.7) * ANGLES(RAD(0), RAD(0), RAD(-95)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1334 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1335 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(95), RAD(0)) * ANGLES(RAD(-15), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1336 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-55), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1337 | end | |
1338 | elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then | |
1339 | ANIM = "Walk" | |
1340 | if ATTACK == false then | |
1341 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.05) * ANGLES(RAD(5), RAD(0), RAD(-15-7 * COS(SINE / (WALKSPEEDVALUE)))), 1 / Animation_Speed) | |
1342 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5 - 1 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(15+7 * COS(SINE / (WALKSPEEDVALUE)))), 1 / Animation_Speed) | |
1343 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(0.75, 0.5 + 0.05 * SIN(SINE / 12), -0.7) * ANGLES(RAD(0), RAD(0), RAD(-95)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1344 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1345 | RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(105), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 2 / Animation_Speed) | |
1346 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 2 / Animation_Speed) | |
1347 | end | |
1348 | end | |
1349 | unanchor() | |
1350 | if INTROD == true then | |
1351 | if SUNFLOAT == true then | |
1352 | SUN.CFrame = Clerp(SUN.CFrame,Torso.CFrame*CF(0,14 + 4 * SIN(SINE / 12),11),0.035) | |
1353 | end | |
1354 | local HITFLOOR,SUNPOS = Raycast(SUN.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 23, Character) | |
1355 | if HITFLOOR then | |
1356 | local DISTANCE = (SUNPOS - SUN.Position).Magnitude | |
1357 | local SIZE = (23 - DISTANCE)*2 | |
1358 | end | |
1359 | end | |
1360 | Humanoid.MaxHealth = 500 | |
1361 | Humanoid.Health = 500 | |
1362 | if Rooted == false then | |
1363 | Disable_Jump = false | |
1364 | Humanoid.WalkSpeed = Speed | |
1365 | elseif Rooted == true then | |
1366 | Disable_Jump = true | |
1367 | Humanoid.WalkSpeed = 0 | |
1368 | end | |
1369 | BMUSIC.SoundId = "rbxassetid://"..SONGID | |
1370 | BMUSIC.Looped = true | |
1371 | BMUSIC.Pitch = PITCH | |
1372 | BMUSIC.Volume = VOLUME | |
1373 | BMUSIC.Playing = INTROD | |
1374 | if BMUSIC.Parent ~= RootPart then | |
1375 | BMUSIC = IT("Sound",RootPart) | |
1376 | end | |
1377 | Humanoid.Name = "THE_SUN_IS_A_DEADLY_LASER" | |
1378 | if INTROD == false and ATTACK == false then | |
1379 | Intro() | |
1380 | INTROD = true | |
1381 | end | |
1382 | local VELOC = -RootPart.RotVelocity.Y | |
1383 | if VELOC < -35 then | |
1384 | VELOC = -35 | |
1385 | elseif VELOC > 35 then | |
1386 | VELOC = 35 | |
1387 | end | |
1388 | if CUSTOMANGLES == true then | |
1389 | Cam.CameraType = Enum.CameraType.Scriptable | |
1390 | if CUSTOMCAM == false then | |
1391 | Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-5), RAD(0), RAD(VELOC)) * CF(12,7,25), 0.15) | |
1392 | end | |
1393 | else | |
1394 | Cam.CameraType = CAMTYPE | |
1395 | end | |
1396 | end | |
1397 | ||
1398 | --//=================================\\ | |
1399 | --\\=================================// | |
1400 | ||
1401 | ||
1402 | ||
1403 | ||
1404 | ||
1405 | --//====================================================\\-- | |
1406 | --|| END OF SCRIPT | |
1407 | --\\====================================================//-- |