SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | ||
3 | ||
4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | do | |
7 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | ||
21 | --Creating fake input objects with fake variables | |
22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
26 | end} | |
27 | --Merged 2 functions into one by checking amount of arguments | |
28 | CAS.UnbindAction = CAS.BindAction | |
29 | ||
30 | --This function will trigger the events that have been :Connect()'ed | |
31 | local function te(self,ev,...) | |
32 | local t = m[ev] | |
33 | if t and t._fakeEvent and t.Function then | |
34 | t.Function(...) | |
35 | end | |
36 | end | |
37 | m.TrigEvent = te | |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=Player then return end | |
42 | if io.isMouse then | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | else | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = game:GetService("Players").LocalPlayer | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local Mouse = Player:GetMouse() | |
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | - | local player = game:GetService("Players").LocalPlayer |
80 | + | h,t=Mouse.Hit,Mouse.Target |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
85 | end | |
86 | - | local Mouse = player:GetMouse() |
86 | + | |
87 | --[[ Double tap W to dash ]] | |
88 | --[[ Q and E to swap spells]] | |
89 | --[[ UPDATE LOG/IDEAS ]---------------------------------------------------------- | |
90 | +Added Void Crush | |
91 | ||
92 | *Maybe add sparkles to fireworks (a trail of some kind) | |
93 | +Maybe add a puff of smoke to fireworks, from the wand at least | |
94 | *SPELL IDEAS: | |
95 | +Stop playing from moving and create a bubble of particles that shoots forward. Use the projectile system? | |
96 | +Add a way to lift up players? | |
97 | +Invisibility spell, leaves footprints or use the Trail script? | |
98 | +Healing spell, shoots a green projectile straight up, rains, each drop heals | |
99 | ++holding down bubbble spell, low damage, large knock back away from player, slowly float up (short range) | |
100 | +teleport opens hole beneath player, opens it above another location | |
101 | +++Chain someone to the floor with the new rope/spring stuff. put selection box on torso, use the connected line/wire to a glowing ball. for 3 sec | |
102 | +Maybe too hard, copy player, rotate but make it do same motions as player, will make it hard to tell which is the real, others fade/take damage to die | |
103 | +Jump slam move, looks up HUUDOKEEEN | |
104 | +lazer move, from 1 side to the other, like a wave | |
105 | --]] | |
106 | --[[ | |
107 | if script.ClassName == "LocalScript" then --advanced stuff I stole from aerx :) | |
108 | if game.PlaceId == 178350907 then | |
109 | script.Parent = nil | |
110 | else | |
111 | local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call) | |
112 | local oxbox = getfenv() setfenv(1, setmetatable({}, {__index = Environment})) | |
113 | Environment.coroutine.yield() | |
114 | oxbox.script:Destroy() | |
115 | end | |
116 | end | |
117 | --]] | |
118 | ----CUSTOMIZATION | |
119 | ||
120 | local MainColor = "Institutional white" | |
121 | local CharacterSpeed = 20 --16 is default | |
122 | local MaxMana = 100 | |
123 | local fireworkSounds = { | |
124 | "rbxassetid://160248280", | |
125 | "rbxassetid://160248302", | |
126 | "rbxassetid://269146157" | |
127 | } | |
128 | local magicSounds = { | |
129 | "rbxassetid://260433768", | |
130 | "rbxassetid://260433746", | |
131 | "rbxassetid://260433721", | |
132 | "rbxassetid://182765513", | |
133 | } | |
134 | local Rainbow = { --This is the main color set. Try to use more than just a few, make it fade in order as well | |
135 | "Crimson", | |
136 | "Bright red", | |
137 | "Neon orange", | |
138 | "Deep orange", | |
139 | "Bright yellow", | |
140 | "New Yeller", | |
141 | "Br. yellowish green", | |
142 | "Lime green", | |
143 | "Sea green", | |
144 | "Bright bluish green", | |
145 | "Bright blue", | |
146 | "Lavender", | |
147 | "Royal purple", | |
148 | "Eggplant", | |
149 | "Hot pink" | |
150 | } | |
151 | ||
152 | ||
153 | --Script starting | |
154 | local spells = {} | |
155 | ||
156 | function addSpell(nm,manac,colorz) | |
157 | table.insert(spells, { ["Name"] = nm, ["ManaCost"] = manac, ["Color"] = BrickColor.new(colorz)}) | |
158 | end | |
159 | ||
160 | addSpell("True Form", 100, "Crimson") | |
161 | addSpell("Void Crush", 30, "Bright green") | |
162 | addSpell("Firework", 5, "Bright blue") | |
163 | addSpell("Teleport", 10, "Neon orange") | |
164 | ||
165 | local player = owner | |
166 | local me = player | |
167 | repeat wait() until player.Character ~= nil | |
168 | local char = player.Character | |
169 | local Character = char | |
170 | local Humanoid = char.Humanoid | |
171 | local Backpack = player.Backpack | |
172 | local PlayerGui = player.PlayerGui | |
173 | local Camera = workspace.CurrentCamera | |
174 | local Humanoid = char:WaitForChild("Humanoid") | |
175 | local torso = char:WaitForChild("Torso") | |
176 | local head = char:WaitForChild("Head") | |
177 | local rightArm = char:WaitForChild("Right Arm") | |
178 | local leftArm = char:WaitForChild("Left Arm") | |
179 | local rightLeg = char:WaitForChild("Right Leg") | |
180 | local leftLeg = char:WaitForChild("Left Leg") | |
181 | local rightShoulder = torso:WaitForChild("Right Shoulder") | |
182 | local leftShoulder = torso:WaitForChild("Left Shoulder") | |
183 | local rightHip = torso:WaitForChild("Right Hip") | |
184 | local leftHip = torso:WaitForChild("Left Hip") | |
185 | local neck = torso:WaitForChild("Neck") | |
186 | local rootpart = char:WaitForChild("HumanoidRootPart") | |
187 | local root = char:WaitForChild("HumanoidRootPart") | |
188 | local rj = rootpart:WaitForChild("RootJoint") | |
189 | local anim = char:WaitForChild("Animate") | |
190 | local TSTable = {} | |
191 | local SpinTable = {} | |
192 | ||
193 | local components = CFrame.new().components | |
194 | rightArm.CanCollide = false | |
195 | leftArm.CanCollide = false | |
196 | rightLeg.CanCollide = false | |
197 | leftLeg.CanCollide = false | |
198 | camera = workspace.CurrentCamera | |
199 | player.CameraMaxZoomDistance = math.huge | |
200 | pcall(function() | |
201 | if anim then anim:remove() | |
202 | for i,v in pairs(Humanoid:GetPlayingAnimationTracks()) do | |
203 | v:Stop() | |
204 | end | |
205 | end | |
206 | end) | |
207 | pcall(function() | |
208 | char["Health"].Disabled = true | |
209 | end) | |
210 | pcall(function() | |
211 | humanoid.Animator:Destroy() | |
212 | end) | |
213 | local rjo = rootpart.RootJoint:Clone() | |
214 | function createWeld(wp0, wp1, wc0x, wc0y, wc0z) | |
215 | local weld = Instance.new("Weld", wp1) | |
216 | weld.Part0 = wp0 | |
217 | weld.Part1 = wp1 | |
218 | weld.C0 = CFrame.new(wc0x, wc0y, wc0z) | |
219 | return weld | |
220 | end | |
221 | ||
222 | local leftArmJoint = createWeld(torso, leftArm, -1.5, 0.5, 0) | |
223 | leftArmJoint.C1 = CFrame.new(0, 0.5, 0) | |
224 | local rightArmJoint = createWeld(torso, rightArm, 1.5, 0.5, 0) | |
225 | rightArmJoint.C1 = CFrame.new(0, 0.5, 0) | |
226 | local neck = createWeld(torso, head, 0, 1, 0) | |
227 | local leftLegJoint = createWeld(torso, leftLeg, -0.5, -1, 0) | |
228 | leftLegJoint.C1 = CFrame.new(0, 1, 0) | |
229 | local rightLegJoint = createWeld(torso, rightLeg, 0.5, -1, 0) | |
230 | rightLegJoint.C1 = CFrame.new(0, 1, 0) | |
231 | local rj = rjo:Clone() | |
232 | rj.Part0 = rootpart | |
233 | rj.Part1 = torso | |
234 | rj.Parent = rootpart | |
235 | neck.C1 = CFrame.new(0, -(1/2), 0) | |
236 | neckc0 = neck.C0 | |
237 | lsc0 = leftArmJoint.C0 | |
238 | rsc0 = rightArmJoint.C0 | |
239 | llc0 = leftLegJoint.C0 | |
240 | rlc0 = rightLegJoint.C0 | |
241 | rootc0 = rj.C0 | |
242 | rootc1 = rj.C1 | |
243 | wait() | |
244 | ||
245 | local pressingW = false | |
246 | local inAction = false | |
247 | char.Humanoid.WalkSpeed = CharacterSpeed | |
248 | local beenHit = {} | |
249 | local jumpPower = 50 | |
250 | --Humanoid.JumpPower = 80 | |
251 | ||
252 | ||
253 | --GUI | |
254 | ||
255 | local x10Wand = Instance.new("ScreenGui") | |
256 | local SelectorBox = Instance.new("ImageLabel") | |
257 | ||
258 | x10Wand.Name = "x10Wand" | |
259 | x10Wand.Parent = me.PlayerGui | |
260 | ||
261 | SelectorBox.Name = "SelectorBox" | |
262 | SelectorBox.Parent = x10Wand | |
263 | SelectorBox.BackgroundColor3 = Color3.new(1, 1, 1) | |
264 | SelectorBox.BackgroundTransparency = 1 | |
265 | SelectorBox.Position = UDim2.new(0.5, -50, 1, -100) | |
266 | SelectorBox.Size = UDim2.new(0, 100, 0, 50) | |
267 | SelectorBox.ZIndex = 10 | |
268 | SelectorBox.Image = "rbxassetid://129944699" | |
269 | SelectorBox.ImageColor3 = Color3.new(1, 0, 0) | |
270 | SelectorBox.ScaleType = Enum.ScaleType.Slice | |
271 | SelectorBox.SliceCenter = Rect.new(0, 10, 0, 195) | |
272 | ||
273 | currentSpell = { ["Name"] = spells[(math.floor(#spells/2)+1)].Name, ["ManaCost"] = spells[(math.floor(#spells/2)+1)].ManaCost } | |
274 | function loadSpellGui() | |
275 | currentSpell = { ["Name"] = spells[(math.floor(#spells/2)+1)].Name, ["ManaCost"] = spells[(math.floor(#spells/2)+1)].ManaCost } | |
276 | print(currentSpell.Name, currentSpell.ManaCost) | |
277 | for i,v in pairs(SelectorBox:GetChildren()) do | |
278 | v:Remove() | |
279 | end | |
280 | local spellPos = -100*(math.floor(#spells/2)) | |
281 | for i,v in pairs(spells) do | |
282 | local Spell = Instance.new("TextLabel") | |
283 | Spell.Name = "Spell" | |
284 | Spell.Parent = SelectorBox | |
285 | Spell.BackgroundColor3 = v.Color.Color | |
286 | Spell.BackgroundTransparency = math.abs(((math.floor(#spells/2)+1)-i))*0.2 | |
287 | if math.abs(((math.floor(#spells/2)+1)-i)) == 1 then | |
288 | Spell.Position = UDim2.new(0,spellPos,0,math.abs(((math.floor(#spells/2)+1)-i))*9) | |
289 | elseif math.abs(((math.floor(#spells/2)+1)-i)) == 2 then | |
290 | Spell.Position = UDim2.new(0,spellPos,0,math.abs(((math.floor(#spells/2)+1)-i))*14) | |
291 | elseif math.abs(((math.floor(#spells/2)+1)-i)) == 3 then | |
292 | Spell.Position = UDim2.new(0,spellPos,0,math.abs(((math.floor(#spells/2)+1)-i))*17) | |
293 | else | |
294 | Spell.Position = UDim2.new(0,spellPos,0,math.abs(((math.floor(#spells/2)+1)-i))*24) | |
295 | end | |
296 | if ((math.floor(#spells/2)+1)-i) < 0 then | |
297 | Spell.Rotation = math.abs(((math.floor(#spells/2)+1)-i))*3 | |
298 | else | |
299 | Spell.Rotation = -math.abs(((math.floor(#spells/2)+1)-i))*3 | |
300 | end | |
301 | Spell.BorderSizePixel = 3 | |
302 | Spell.Size = UDim2.new(0, 100, 0, 50) | |
303 | Spell.Font = Enum.Font.Code | |
304 | Spell.FontSize = Enum.FontSize.Size14 | |
305 | Spell.Text = v.Name | |
306 | Spell.ZIndex = (9-(math.abs(((math.floor(#spells/2)+1)-i)))) | |
307 | Spell.TextColor3 = Color3.new(0, 0, 0) | |
308 | Spell.TextWrapped = true | |
309 | ||
310 | local ManaCost = Instance.new("TextLabel") | |
311 | ManaCost.Name = "ManaCost" | |
312 | ManaCost.Parent = Spell | |
313 | ManaCost.BackgroundColor3 = Color3.new(1, 1, 1) | |
314 | ManaCost.BackgroundTransparency = 1 | |
315 | ManaCost.Size = UDim2.new(0, 100, 0, 50) | |
316 | ManaCost.Font = Enum.Font.Code | |
317 | ManaCost.ZIndex = 10000 | |
318 | ManaCost.FontSize = Enum.FontSize.Size14 | |
319 | ManaCost.Text = v.ManaCost | |
320 | ManaCost.TextColor3 = Color3.new(0.15, 0, 1) | |
321 | ManaCost.TextYAlignment = Enum.TextYAlignment.Bottom | |
322 | if Spell.Transparency >= 1 then | |
323 | Spell.Visible = false | |
324 | else | |
325 | Spell.Visible = true | |
326 | end | |
327 | ||
328 | spellPos = spellPos + 100 | |
329 | end | |
330 | end | |
331 | loadSpellGui() | |
332 | ||
333 | local Q = Instance.new("TextLabel") | |
334 | Q.Name = "Q" | |
335 | Q.Parent = x10Wand | |
336 | Q.BackgroundColor3 = Color3.new(1, 1, 1) | |
337 | Q.BackgroundTransparency = 1 | |
338 | Q.Position = UDim2.new(0.5, -350, 1, -100) | |
339 | Q.Size = UDim2.new(0, 100, 0, 50) | |
340 | Q.Font = Enum.Font.Cartoon | |
341 | Q.FontSize = Enum.FontSize.Size42 | |
342 | Q.Text = "Q" | |
343 | Q.TextColor3 = Color3.new(1, 1, 1) | |
344 | Q.TextStrokeTransparency = 0 | |
345 | ||
346 | local E = Instance.new("TextLabel") | |
347 | E.Name = "E" | |
348 | E.Parent = x10Wand | |
349 | E.BackgroundColor3 = Color3.new(1, 1, 1) | |
350 | E.BackgroundTransparency = 1 | |
351 | E.Position = UDim2.new(0.5, 250, 1, -100) | |
352 | E.Size = UDim2.new(0, 100, 0, 50) | |
353 | E.Font = Enum.Font.Cartoon | |
354 | E.FontSize = Enum.FontSize.Size42 | |
355 | E.Text = "E" | |
356 | E.TextColor3 = Color3.new(1, 1, 1) | |
357 | E.TextStrokeTransparency = 0 | |
358 | ||
359 | local Info = Instance.new("TextLabel") | |
360 | Info.Name = "Info" | |
361 | Info.Parent = x10Wand | |
362 | Info.BackgroundColor3 = Color3.new(1, 1, 1) | |
363 | Info.BackgroundTransparency = 1 | |
364 | Info.Draggable = true | |
365 | Info.Position = UDim2.new(0.5, -200, 1, -30) | |
366 | Info.Size = UDim2.new(0, 400, 0, 10) | |
367 | Info.ZIndex = 10 | |
368 | Info.Font = Enum.Font.SourceSans | |
369 | Info.FontSize = Enum.FontSize.Size18 | |
370 | Info.Text = "B" .. "y | " .. "Th" .. "un" .. "de" .. "r" .. "x" .. tostring(10) | |
371 | Info.TextColor3 = Color3.new(1, 1, 1) | |
372 | ||
373 | local ManaFrame = Instance.new("Frame") | |
374 | ManaFrame.Name = "ManaFrame" | |
375 | ManaFrame.Parent = x10Wand | |
376 | ManaFrame.BackgroundColor3 = Color3.new(0, 0, 0) | |
377 | ManaFrame.BorderSizePixel = 0 | |
378 | ManaFrame.Position = UDim2.new(0.5, 10, 1, -145) | |
379 | ManaFrame.Size = UDim2.new(0, 204, 0, 24) | |
380 | ||
381 | local ManaBar = Instance.new("Frame") | |
382 | ManaBar.Name = "ManaBar" | |
383 | ManaBar.Parent = ManaFrame | |
384 | ManaBar.BackgroundColor3 = Color3.new(0, 0.317647, 1) | |
385 | ManaBar.BorderSizePixel = 0 | |
386 | ManaBar.Position = UDim2.new(0, 2, 0, 2) | |
387 | ManaBar.Size = UDim2.new(0, 200, 0, 20) | |
388 | ManaBar.ZIndex = 2 | |
389 | ||
390 | local ManaText = Instance.new("TextLabel") | |
391 | ManaText.Name = "ManaText" | |
392 | ManaText.Parent = ManaFrame | |
393 | ManaText.BackgroundColor3 = Color3.new(1, 1, 1) | |
394 | ManaText.BackgroundTransparency = 1 | |
395 | ManaText.Size = UDim2.new(0, 204, 0, 24) | |
396 | ManaText.ZIndex = 4 | |
397 | ManaText.Font = Enum.Font.SciFi | |
398 | ManaText.FontSize = Enum.FontSize.Size18 | |
399 | ManaText.Text = MaxMana | |
400 | ManaText.TextColor3 = Color3.new(1, 1, 1) | |
401 | ||
402 | local HealthFrame = Instance.new("Frame") | |
403 | HealthFrame.Name = "HealthFrame" | |
404 | HealthFrame.Parent = x10Wand | |
405 | HealthFrame.BackgroundColor3 = Color3.new(0, 0, 0) | |
406 | HealthFrame.BorderSizePixel = 0 | |
407 | HealthFrame.Position = UDim2.new(0.5, -214, 1, -145) | |
408 | HealthFrame.Size = UDim2.new(0, 204, 0, 24) | |
409 | ||
410 | local HealthBar = Instance.new("Frame") | |
411 | HealthBar.Name = "HealthBar" | |
412 | HealthBar.Parent = HealthFrame | |
413 | HealthBar.BackgroundColor3 = Color3.new(0, 0.8, 0.02) | |
414 | HealthBar.BorderSizePixel = 0 | |
415 | HealthBar.Position = UDim2.new(0, 2, 0, 2) | |
416 | HealthBar.Size = UDim2.new(0, char.Humanoid.Health*2, 0, 20) | |
417 | HealthBar.ZIndex = 2 | |
418 | ||
419 | local HealthText = Instance.new("TextLabel") | |
420 | HealthText.Name = "HealthText" | |
421 | HealthText.Parent = HealthFrame | |
422 | HealthText.BackgroundColor3 = Color3.new(1, 1, 1) | |
423 | HealthText.BackgroundTransparency = 1 | |
424 | HealthText.Size = UDim2.new(0, 204, 0, 24) | |
425 | HealthText.ZIndex = 4 | |
426 | HealthText.Font = Enum.Font.SciFi | |
427 | HealthText.FontSize = Enum.FontSize.Size18 | |
428 | HealthText.Text = math.ceil(char.Humanoid.Health) | |
429 | HealthText.TextColor3 = Color3.new(1, 1, 1) | |
430 | ||
431 | --WEAPON | |
432 | ||
433 | local model = Instance.new("Model", char) | |
434 | model.Name = "x10Wand" | |
435 | ||
436 | local wm = Instance.new("Part", model) | |
437 | wm.Material = "SmoothPlastic" | |
438 | wm.BrickColor = BrickColor.new("Really black") | |
439 | wm.Size = Vector3.new(0,0,0) | |
440 | wm.CFrame = CFrame.new(0,5,0) | |
441 | wm.CanCollide = false | |
442 | wm.TopSurface = "Smooth" | |
443 | wm.BottomSurface = "Smooth" | |
444 | local Mesh = Instance.new("CylinderMesh", wm) | |
445 | Mesh.Scale = Vector3.new(1,9,1) | |
446 | ||
447 | local wmt = Instance.new("Part", model) | |
448 | wmt.Material = "SmoothPlastic" | |
449 | wmt.BrickColor = BrickColor.new(MainColor) | |
450 | wmt.Size = Vector3.new(0,0,0) | |
451 | wmt.CanCollide = false | |
452 | wmt.CFrame = CFrame.new(0,5,0) | |
453 | wmt.Material = "Neon" | |
454 | wmt.TopSurface = "Smooth" | |
455 | wmt.BottomSurface = "Smooth" | |
456 | local Mesh = Instance.new("CylinderMesh", wmt) | |
457 | Mesh.Scale = Vector3.new(1.1,1.8,1.1) | |
458 | ||
459 | local weld = Instance.new("Weld", wmt) | |
460 | weld.Part0 = wmt | |
461 | weld.Part1 = wm | |
462 | weld.C0 = CFrame.new(0, 0.8, 0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
463 | ||
464 | local weaponWeld = Instance.new("Weld") | |
465 | weaponWeld.Parent = wm | |
466 | weaponWeld.Part0 = wm | |
467 | weaponWeld.Part1 = char["Right Arm"] | |
468 | weaponWeld.C0 = CFrame.new(0, 0.3, -1)*CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) | |
469 | local weaponWeldc0 = weaponWeld.C0 | |
470 | ||
471 | --FUNCTIONS | |
472 | print("v2") | |
473 | function takeDamage(position, damage, distance, platformStand) | |
474 | playersHit = {} | |
475 | for i,v in pairs(workspace:GetChildren()) do | |
476 | currentPlayer = nil | |
477 | if v.Name == "Dummy" then | |
478 | currentPlayer = v | |
479 | else | |
480 | if game:GetService("Players"):GetPlayerFromCharacter(v) ~= nil and v.Name ~= me.Name and v:IsA("Model") and v.Name ~= "Script" then | |
481 | if v.Name == game:GetService("Players"):GetPlayerFromCharacter(v).Name then | |
482 | currentPlayer = v | |
483 | end | |
484 | end | |
485 | end | |
486 | if currentPlayer ~= nil then | |
487 | if currentPlayer:findFirstChild("Torso") and currentPlayer:findFirstChild("Humanoid") and (currentPlayer.Torso.Position - position).magnitude < distance then | |
488 | dealDamage(currentPlayer.Humanoid, damage) | |
489 | table.insert(playersHit, currentPlayer) | |
490 | currentPlayer.Humanoid.PlatformStand = platformStand | |
491 | print(v.Name) | |
492 | end | |
493 | end | |
494 | end | |
495 | for i,v in pairs(playersHit) do | |
496 | print(i,v) | |
497 | end | |
498 | return playersHit | |
499 | end | |
500 | ||
501 | function freeze(time) | |
502 | local g = Instance.new("BodyGyro", root) | |
503 | g.Name = "BodyMovement" | |
504 | g.D = 0 | |
505 | g.CFrame = root.CFrame | |
506 | g.MaxTorque = Vector3.new(1000000000, 1000000000, 1000000000) | |
507 | g.P = 10000000000 | |
508 | if time ~= nil then | |
509 | game:GetService("Debris"):AddItem(g,time) | |
510 | end | |
511 | end | |
512 | ||
513 | function unfreeze() | |
514 | for i,v in pairs(root:GetChildren()) do | |
515 | if v.Name == "BodyMovement" then | |
516 | v:Remove() | |
517 | end | |
518 | end | |
519 | end | |
520 | ||
521 | function moveVelocity(direction, speed, time) | |
522 | local g = Instance.new("BodyGyro", root) | |
523 | g.D = 0 | |
524 | g.CFrame = root.CFrame | |
525 | g.MaxTorque = Vector3.new(1000000000, 1000000000, 1000000000) | |
526 | g.P = 10000000000 | |
527 | local e = Instance.new("BodyVelocity", root) | |
528 | e.Velocity = dir.unit * speed | |
529 | e.P = 10000 | |
530 | e.MaxForce = Vector3.new(100000000, 100000000, 100000000) | |
531 | game:GetService("Debris"):AddItem(e,time) | |
532 | end | |
533 | ||
534 | local SpikeCount = 0 | |
535 | function createPath() | |
536 | SpikeCount = SpikeCount + 1 | |
537 | if SpikeCount >= 10 then | |
538 | SpikeCount = 0 | |
539 | local spike = Instance.new("Part", model) | |
540 | table.insert(TSTable, spike) | |
541 | spike.Size = Vector3.new(0,0,0) | |
542 | spike.Name = "Ring" | |
543 | spike.Material = "Neon" | |
544 | spike.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
545 | spike.Anchored = true | |
546 | spike.Transparency = 0.3 | |
547 | spike.CanCollide = false | |
548 | spike.CFrame = torso.CFrame*CFrame.new(0,0,3)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
549 | local spikemesh = Instance.new("SpecialMesh", spike) | |
550 | spikemesh.Name = "SpikeMesh" | |
551 | spikemesh.Scale = Vector3.new(5,5,5) | |
552 | spikemesh.MeshId = "http://www.roblox.com/asset/?id=3270017" | |
553 | end | |
554 | ||
555 | local spike1 = Instance.new("Part", model) | |
556 | table.insert(TSTable, spike1) | |
557 | spike1.Size = Vector3.new(0,0,0) | |
558 | spike1.Material = "Neon" | |
559 | spike1.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
560 | spike1.Anchored = true | |
561 | spike1.Transparency = 0 | |
562 | spike1.CanCollide = false | |
563 | spike1.CFrame = torso.CFrame*CFrame.new(0,0,1.5)*CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) | |
564 | local spikemesh1 = Instance.new("CylinderMesh", spike1) | |
565 | spikemesh1.Name = "SpikeMesh" | |
566 | spikemesh1.Scale = Vector3.new(6,10,6) | |
567 | end | |
568 | ||
569 | local function CreateRegion3FromLocAndSize(Position, Size) | |
570 | local SizeOffset = Size/2 | |
571 | local Point1 = Position - SizeOffset | |
572 | local Point2 = Position + SizeOffset | |
573 | return Region3.new(Point1, Point2) | |
574 | end | |
575 | ||
576 | function dealDamage(targetHumanoid, damage) | |
577 | if targetHumanoid.Health > 100 then | |
578 | targetHumanoid.MaxHealth = 100 | |
579 | targetHumanoid.Health = 100 | |
580 | end | |
581 | targetHumanoid.Health = targetHumanoid.Health - damage | |
582 | end | |
583 | ||
584 | function makeParticles() | |
585 | local p = Instance.new("Part", char) | |
586 | p.CanCollide = false | |
587 | p.BrickColor = BrickColor.new(Rainbow[math.random(1,#Rainbow)]) | |
588 | p.Material = "Neon" | |
589 | p.Name = "Particle" | |
590 | p.Size = Vector3.new(0,0,0) | |
591 | p.CFrame = wmt.CFrame*CFrame.new(math.random(-1,1), math.random(-1,1), math.random(-1,1))*CFrame.Angles(math.rad(math.random(0,360)), math.rad(math.random(0,360)), math.rad(math.random(0,360))) | |
592 | game:GetService("Debris"):AddItem(p,3) | |
593 | table.insert(currentTable, p) | |
594 | local bbp = Instance.new("BodyPosition", p) | |
595 | bbp.Name = "forceinward" | |
596 | bbp.MaxForce = Vector3.new(math.random(1000, 2000), math.random(1000, 2000), math.random(1000, 2000)) | |
597 | bbp.P = math.random(3000, 5000) | |
598 | if isCharging then | |
599 | bbp.Position = wmt.Position | |
600 | bbp.D = 1000 | |
601 | else | |
602 | bbp.Position = p.Position + Vector3.new(math.random(-1,1), 1, math.random(-1,1)) | |
603 | bbp.D = 2000 | |
604 | end | |
605 | table.insert(allbps, bbp) | |
606 | end | |
607 | ||
608 | function OriginalProjectile(loc) | |
609 | local proj = Instance.new("Part", model) | |
610 | proj.CanCollide = false | |
611 | proj.Name = "projectile" | |
612 | proj.CFrame = wmt.CFrame | |
613 | proj.Anchored = true | |
614 | proj.Material = "Neon" | |
615 | proj.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
616 | proj.CFrame = CFrame.new(proj.Position, loc) | |
617 | proj.Size = Vector3.new(0.3, 0.3, 2) | |
618 | local s = Instance.new("Sound", wmt) | |
619 | s.SoundId = fireworkSounds[math.random(1,#fireworkSounds)] | |
620 | s.EmitterSize = 10 | |
621 | s.Volume = math.random(80,100)/10 | |
622 | s:Play() | |
623 | game:GetService("Debris"):AddItem(s,5) | |
624 | local s = Instance.new("Sound", proj) | |
625 | s.SoundId = "rbxassetid://84903136" | |
626 | s.EmitterSize = 10 | |
627 | s.Volume = math.random(80,100)/10 | |
628 | s:Play() | |
629 | game:GetService("Debris"):AddItem(s, 5) | |
630 | table.insert(projectiles, proj) | |
631 | end | |
632 | ||
633 | function createHole(location, height) | |
634 | if (torso.Position - location).magnitude < 2000 then | |
635 | local hole = Instance.new("Part", model) | |
636 | hole.BrickColor = BrickColor.new("Really black") | |
637 | hole.Size = Vector3.new(0,0,0) | |
638 | hole.Anchored = true | |
639 | hole.CFrame = CFrame.new(location.X,location.Y,location.Z)*CFrame.new(0,height,0) | |
640 | hole.Material = "SmoothPlastic" | |
641 | local cm = Instance.new("CylinderMesh",hole) | |
642 | cm.Name = "HoleMesh" | |
643 | cm.Scale = Vector3.new(0,0,0) | |
644 | table.insert(holeTable, hole) | |
645 | local s = Instance.new("Sound", hole) --whole opening | |
646 | s.SoundId = magicSounds[math.random(1,#magicSounds)] | |
647 | s.EmitterSize = 50 | |
648 | s.Volume = 100 | |
649 | s:Play() | |
650 | game:GetService("Debris"):AddItem(s,5) | |
651 | end | |
652 | end | |
653 | ||
654 | function freeze(who) | |
655 | for i,v in pairs(who:GetChildren()) do | |
656 | if v:IsA("Part") and v.Name ~= "HumanoidRootPart" then | |
657 | v.Anchored = true | |
658 | end | |
659 | end | |
660 | end | |
661 | ||
662 | function unfreeze(who) | |
663 | for i,v in pairs(who:GetChildren()) do | |
664 | if v:IsA("Part") and v.Name ~= "HumanoidRootPart" then | |
665 | v.Anchored = false | |
666 | end | |
667 | end | |
668 | end | |
669 | ||
670 | function castingStart(length) | |
671 | local s = Instance.new("Sound", wmt) --wavy noise | |
672 | s.SoundId = "rbxassetid://262327541" | |
673 | s.EmitterSize = 10 | |
674 | s.Volume = 100 | |
675 | s:Play() | |
676 | game:GetService("Debris"):AddItem(s,5) | |
677 | castRing = Instance.new("Part", model) | |
678 | castRing.Size = Vector3.new(0,0,0) | |
679 | castRing.Name = "CastingRing" | |
680 | castRing.Material = "Neon" | |
681 | castRing.BrickColor = BrickColor.new("Industrial white") | |
682 | castRing.Anchored = true | |
683 | castRing.Transparency = 0.5 | |
684 | castRing.CanCollide = false | |
685 | castRing.CFrame = CFrame.new(Mouse.Hit.p.X,Mouse.Hit.p.Y+0.3,Mouse.Hit.p.Z)*CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) | |
686 | local ringmesh = Instance.new("SpecialMesh", castRing) | |
687 | ringmesh.Name = "RingMesh" | |
688 | ringmesh.Scale = Vector3.new(2,2,2) | |
689 | ringmesh.MeshId = "http://www.roblox.com/asset/?id=3270017" | |
690 | game:GetService("Debris"):AddItem(castRing, length) --casting time | |
691 | castCircle = Instance.new("Part", model) | |
692 | castCircle.Size = Vector3.new(0,0,0) | |
693 | castCircle.Name = "CastingCircle" | |
694 | castCircle.Material = "Neon" | |
695 | castCircle.Shape = "Cylinder" | |
696 | castCircle.BrickColor = BrickColor.new("Industrial white") | |
697 | castCircle.Anchored = true | |
698 | castCircle.Transparency = 0.2 | |
699 | castCircle.CanCollide = false | |
700 | castCircle.CFrame = CFrame.new(Mouse.Hit.p.X,Mouse.Hit.p.Y+0.3,Mouse.Hit.p.Z)*CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) | |
701 | local ringmesh = Instance.new("CylinderMesh", castCircle) | |
702 | ringmesh.Name = "RingMesh" | |
703 | ringmesh.Scale = Vector3.new(4,0.2,4) | |
704 | game:GetService("Debris"):AddItem(castCircle, length) --casting time | |
705 | game:GetService("Debris"):AddItem(s, length) --casting time | |
706 | end | |
707 | ||
708 | -- | |
709 | ||
710 | rainbowNumber = 1 | |
711 | statRegenNumber = 0 | |
712 | holdingw = false | |
713 | Mana = 100 | |
714 | currentTable = {} | |
715 | walkingAnimationSpeed = 3.5 | |
716 | allbps = {} | |
717 | projectiles = {} | |
718 | holeTable = {} | |
719 | rainbowMode = false | |
720 | int = 0 | |
721 | bodyparts = {} | |
722 | holdingMouse1 = false | |
723 | local currentAnim = "walk" | |
724 | local actionWalking = true | |
725 | local isCharging = false | |
726 | local slowingDown = 1 | |
727 | local Smooth = 1 | |
728 | local t = tick() | |
729 | game:GetService("RunService").Stepped:connect(function() | |
730 | t = t+0.5*Smooth | |
731 | statRegenNumber = statRegenNumber + 1 | |
732 | if statRegenNumber >= 10 then | |
733 | if currentAnim == "Dashing" then | |
734 | if Mana > 0 then | |
735 | Mana = Mana - 1 | |
736 | else | |
737 | holdingw = false | |
738 | end | |
739 | else | |
740 | if Mana < MaxMana then | |
741 | Mana = Mana + 1 | |
742 | end | |
743 | end | |
744 | if char.Humanoid.Health < char.Humanoid.MaxHealth then | |
745 | char.Humanoid.Health = char.Humanoid.Health + 1 | |
746 | end | |
747 | statRegenNumber = 0 | |
748 | end | |
749 | HealthText.Text = math.ceil(char.Humanoid.Health) | |
750 | if char.Humanoid.Health <= 100 then | |
751 | HealthBar.Size = UDim2.new(0, math.ceil(char.Humanoid.Health)*2, 0, 20) | |
752 | end | |
753 | ManaText.Text = Mana | |
754 | if Mana <= 100 then | |
755 | ManaBar.Size = UDim2.new(0, Mana*2, 0, 20) | |
756 | end | |
757 | if not inAction then | |
758 | weaponWeld.C0 = weaponWeld.C0:lerp(weaponWeldc0,0.05) | |
759 | if rootpart.Velocity.y > 1 and Humanoid:GetState() == Enum.HumanoidStateType.Freefall then | |
760 | currentAnim = "jump" | |
761 | elseif rootpart.Velocity.y < -1 then | |
762 | currentAnim = "freefall" | |
763 | elseif (math.abs(rootpart.Velocity.x) > 2 or math.abs(rootpart.Velocity.z) > 2) and Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then | |
764 | currentAnim = "walk" | |
765 | elseif Vector3.new(rootpart.Velocity.x,0,rootpart.Velocity.y).magnitude < 1 and Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then | |
766 | currentAnim = "idle" | |
767 | end | |
768 | ||
769 | if currentAnim == "idle" then | |
770 | animationSpeed = 0.1 | |
771 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.Angles(math.rad(-1), math.rad(-1), -(math.sin(t/7)/20)+0.1), animationSpeed) | |
772 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-1), math.rad(0), (math.sin(t/7)/20)-0.1), animationSpeed) | |
773 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,math.sin(t/7)/30,0)*CFrame.Angles(math.rad(-2), math.rad(0), math.rad(1)), animationSpeed) | |
774 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,math.sin(t/7)/30,0)*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-1), math.rad(0), math.rad(-1)), animationSpeed) | |
775 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
776 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,-math.sin(t/7)/30)*CFrame.Angles(math.rad(-1), math.rad(0), math.rad(0)),animationSpeed) | |
777 | elseif currentAnim == "walk" then | |
778 | animationSpeed = 0.05 | |
779 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles((math.sin(t/5)/25)+math.rad(-30), math.rad(-42), math.rad(17)), animationSpeed) | |
780 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles((math.sin(t/5)/25)+math.rad(-51), math.rad(42), math.rad(-11)), animationSpeed) | |
781 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,math.sin(t/5)/25,0)*CFrame.Angles((-math.sin(t/walkingAnimationSpeed)/1)+math.rad(0), math.rad(0), math.rad(0)), 0.4) | |
782 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,math.sin(t/5)/25,0)*CFrame.Angles((math.sin(t/walkingAnimationSpeed)/1)+math.rad(0), math.rad(0), math.rad(0)), 0.4) | |
783 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
784 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,-math.sin(t/5)/25)*CFrame.Angles(math.rad(10), math.rad(0), math.rad(0)),0.4) | |
785 | elseif currentAnim == "jump" then | |
786 | animationSpeed = 0.2 | |
787 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-11), math.rad(-2), math.rad(12)), animationSpeed) | |
788 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-8), math.rad(2), math.rad(-17)), animationSpeed) | |
789 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-11), math.rad(0), math.rad(4)), animationSpeed) | |
790 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-16), math.rad(1), math.rad(-4)), animationSpeed) | |
791 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(8), math.rad(0), math.rad(0)),animationSpeed) | |
792 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
793 | elseif currentAnim == "freefall" then | |
794 | animationSpeed = 0.15 | |
795 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(-(math.sin(t/4)/7)+math.rad(-15), math.rad(0), -(math.sin(t/5)/10)+math.rad(10)), animationSpeed) | |
796 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles((math.sin(t/4)/7)+math.rad(-12), math.rad(4), (math.sin(t/5)/10)+math.rad(-10)), animationSpeed) | |
797 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,0,0)*CFrame.Angles((math.sin(t/4)/7)+math.rad(-8), math.rad(0), (math.sin(t/5)/10)+math.rad(6)), animationSpeed) | |
798 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,0,0)*CFrame.Angles(-(math.sin(t/4)/7)+math.rad(0), math.rad(1), (math.sin(t/5)/10)+math.rad(-6)), animationSpeed) | |
799 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
800 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
801 | end | |
802 | else --starting abilities | |
803 | if actionWalking then | |
804 | if (math.abs(rootpart.Velocity.x) > 2 or math.abs(rootpart.Velocity.z) > 2) and Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then | |
805 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,math.sin(t/5)/25,0)*CFrame.Angles((-math.sin(t/walkingAnimationSpeed)/1)+math.rad(0), math.rad(0), math.rad(0)), 0.4) | |
806 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,math.sin(t/5)/25,0)*CFrame.Angles((math.sin(t/walkingAnimationSpeed)/1)+math.rad(0), math.rad(0), math.rad(0)), 0.4) | |
807 | else | |
808 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), 0.05) | |
809 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), 0.05) | |
810 | end | |
811 | end | |
812 | if currentAnim == "ArmUp" then | |
813 | animationSpeed = 0.3 | |
814 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(79), math.rad(-5), math.rad(1)), animationSpeed) | |
815 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(62), math.rad(-3), math.rad(-3)), 0.07) | |
816 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(10)),0.07) | |
817 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.07) | |
818 | elseif currentAnim == "Slash1" then | |
819 | animationSpeed = 0.15 | |
820 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-150), math.rad(20), math.rad(40)), animationSpeed) | |
821 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(62), math.rad(-3), math.rad(-3)), 0.07) | |
822 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(10)),0.07) | |
823 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.07) | |
824 | makeParticles() | |
825 | elseif currentAnim == "SlashMini" then | |
826 | animationSpeed = 0.3 | |
827 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(-0.3,0,-1)*CFrame.Angles(math.rad(23), math.rad(-20), math.rad(-62)), animationSpeed) | |
828 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-49), math.rad(7), math.rad(-1)), animationSpeed) | |
829 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
830 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
831 | weaponWeld.C0 = weaponWeld.C0:lerp(weaponWeldc0*CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), animationSpeed) | |
832 | makeParticles() | |
833 | elseif currentAnim == "Slash2" then | |
834 | animationSpeed = 0.3 | |
835 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(70), math.rad(3), math.rad(-13)), animationSpeed) | |
836 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-49), math.rad(7), math.rad(-1)), animationSpeed) | |
837 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
838 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
839 | weaponWeld.C0 = weaponWeld.C0:lerp(weaponWeldc0*CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(-10)), animationSpeed) | |
840 | makeParticles() | |
841 | elseif currentAnim == "DashDown" then | |
842 | animationSpeed = 0.3 | |
843 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-88), math.rad(-47), math.rad(24)), animationSpeed) | |
844 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,-0.5,0)*CFrame.Angles(math.rad(42), math.rad(-5), math.rad(-5)), animationSpeed) | |
845 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,1.5,-0.5)*CFrame.Angles(math.rad(24), math.rad(3), math.rad(1)), animationSpeed) | |
846 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-40), math.rad(1), math.rad(-3)), animationSpeed) | |
847 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-11), math.rad(0), math.rad(0)),animationSpeed) | |
848 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,-1.3)*CFrame.Angles(math.rad(30), math.rad(0), math.rad(0)),animationSpeed) | |
849 | local spike = Instance.new("Part", model) | |
850 | table.insert(SpinTable, spike) | |
851 | spike.Size = Vector3.new(0,0,0) | |
852 | spike.Name = "spinnything" | |
853 | spike.Material = "Neon" | |
854 | spike.BrickColor = BrickColor.new(MainColor) | |
855 | spike.Anchored = true | |
856 | spike.Transparency = 0.5 | |
857 | spike.CanCollide = false | |
858 | spike.CFrame = CFrame.new(torso.Position.x,(torso.Position.y - 2.5),torso.Position.z)*CFrame.Angles(math.rad(0), math.rad(math.random(0,180)), math.rad(0)) | |
859 | local spikemesh = Instance.new("BlockMesh", spike) | |
860 | spikemesh.Name = "SpikeMesh" | |
861 | spikemesh.Scale = Vector3.new(5,5,5) | |
862 | local ball = Instance.new("Part", model) | |
863 | ball.Size = Vector3.new(0,0,0) | |
864 | ball.Name = "ballthing" | |
865 | ball.Material = "Neon" | |
866 | ball.BrickColor = BrickColor.new(MainColor) | |
867 | ball.Anchored = true | |
868 | ball.Transparency = 0.5 | |
869 | ball.CanCollide = false | |
870 | ball.CFrame = CFrame.new(torso.Position.x,(torso.Position.y - 2.5),torso.Position.z) | |
871 | local spikemesh = Instance.new("SpecialMesh", ball) | |
872 | spikemesh.Name = "SpikeMesh" | |
873 | spikemesh.MeshType = "Sphere" | |
874 | spikemesh.Scale = Vector3.new(5,5,5) | |
875 | table.insert(SpinTable,ball) | |
876 | makeParticles() | |
877 | elseif currentAnim == "Dashing" then | |
878 | animationSpeed = 0.3 | |
879 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles((math.sin(t/4)/7)+math.rad(-66), math.rad(-24), (math.sin(t/5)/10)+math.rad(25)), animationSpeed) | |
880 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(-(math.sin(t/4)/7)+math.rad(-64), math.rad(31), -(math.sin(t/5)/10)+math.rad(-25)), animationSpeed) | |
881 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,0,0)*CFrame.Angles(-(math.sin(t/4)/7)+math.rad(-49), math.rad(-19), math.rad(20)), animationSpeed) | |
882 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,0,0)*CFrame.Angles((math.sin(t/4)/7)+math.rad(-49), math.rad(13), math.rad(-12)), animationSpeed) | |
883 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(5), math.rad(0), math.rad(0)),animationSpeed) | |
884 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
885 | rootpart.CFrame = rootpart.CFrame*CFrame.new(0,0,-2) | |
886 | createPath() | |
887 | elseif currentAnim == "DashSlowing" then | |
888 | animationSpeed = 0.2 | |
889 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(12), math.rad(0), math.rad(0)), animationSpeed) | |
890 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(28), math.rad(0), math.rad(0)), animationSpeed) | |
891 | rightLegJoint.C0 = rightLegJoint.C0:lerp(rlc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(21), math.rad(0), math.rad(3)), animationSpeed) | |
892 | leftLegJoint.C0 = leftLegJoint.C0:lerp(llc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(23), math.rad(-1), math.rad(-2)), animationSpeed) | |
893 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(-5), math.rad(0), math.rad(0)),animationSpeed) | |
894 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
895 | rootpart.CFrame = rootpart.CFrame*CFrame.new(0,0,-slowingDown) | |
896 | slowingDown = slowingDown - 0.05 | |
897 | elseif currentAnim == "Casting" then | |
898 | animationSpeed = 0.3 | |
899 | rightArmJoint.C0 = rightArmJoint.C0:lerp(rsc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(138), -(math.sin(t/4)/4)+math.rad(0), math.rad(13)), animationSpeed) | |
900 | leftArmJoint.C0 = leftArmJoint.C0:lerp(lsc0*CFrame.new(0,0,0)*CFrame.Angles((math.sin(t/5)/25)+math.rad(-21), math.rad(10), math.rad(-11)), animationSpeed) | |
901 | neck.C0 = neck.C0:lerp(neckc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
902 | rj.C0 = rj.C0:lerp(rootc0*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),animationSpeed) | |
903 | weaponWeld.C0 = weaponWeld.C0:lerp(weaponWeldc0*CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), animationSpeed) | |
904 | pcall(function() | |
905 | castRing.CFrame = CFrame.new(Mouse.Hit.p.X,Mouse.Hit.p.Y+0.3,Mouse.Hit.p.Z)*CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) | |
906 | castRing.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
907 | castCircle.CFrame = CFrame.new(Mouse.Hit.p.X,Mouse.Hit.p.Y+0.3,Mouse.Hit.p.Z)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
908 | end) | |
909 | makeParticles() | |
910 | end | |
911 | end | |
912 | if #TSTable > 0 then | |
913 | for i,v in pairs(TSTable) do | |
914 | if v.Transparency <= 1 then | |
915 | v.Transparency = v.Transparency + 0.02 | |
916 | if v.Name == "Ring" then | |
917 | pcall(function() | |
918 | v.SpikeMesh.Scale = v.SpikeMesh.Scale - Vector3.new(0.2,0.2,0) | |
919 | end) | |
920 | elseif v.Name == "SlamRing" then | |
921 | v.Transparency = v.Transparency - 0.01 | |
922 | pcall(function() | |
923 | v.SpikeMesh.Scale = v.SpikeMesh.Scale + Vector3.new(3,3,3) | |
924 | end) | |
925 | elseif v.Name == "GRASS" then | |
926 | v.Transparency = v.Transparency - 0.016 | |
927 | if v.Transparency > 0.5 then | |
928 | v.CanCollide = false | |
929 | end | |
930 | elseif v.Name == "firework" then | |
931 | v.Transparency = v.Transparency - 0.01 | |
932 | pcall(function() | |
933 | v.SpikeMesh.Scale = v.SpikeMesh.Scale - Vector3.new(0.05,0.05,0.05) | |
934 | end) | |
935 | else | |
936 | pcall(function() | |
937 | v.SpikeMesh.Scale = v.SpikeMesh.Scale - Vector3.new(0.2,0,0.2) | |
938 | end) | |
939 | end | |
940 | else | |
941 | table.remove(TSTable, i) | |
942 | v:Remove() | |
943 | end | |
944 | end | |
945 | end | |
946 | if #currentTable > 0 then | |
947 | for i,v in pairs(currentTable) do | |
948 | if isCharging then | |
949 | v.forceinward.Position = wmt.Position | |
950 | end | |
951 | v.Transparency = v.Transparency + 0.05 | |
952 | if v.Transparency >= 1 then | |
953 | table.remove(currentTable, i) | |
954 | table.remove(allbps, i) | |
955 | v:Remove() | |
956 | end | |
957 | end | |
958 | end | |
959 | if #holeTable > 0 then | |
960 | for i,hole in pairs(holeTable) do | |
961 | if hole.HoleMesh.Scale.X < 100 and hole:findFirstChild("BLOCK") == nil then | |
962 | hole.HoleMesh.Scale = hole.HoleMesh.Scale + Vector3.new(10,0,10) | |
963 | else | |
964 | if hole:findFirstChild("BLOCK") == nil then | |
965 | local block = Instance.new("Part", hole) | |
966 | block.Name = "BLOCK" | |
967 | block.Size = Vector3.new(9,0,9) | |
968 | block.Anchored = true | |
969 | block.CFrame = hole.CFrame*CFrame.new(0,-0.25,0) | |
970 | block.Material = "SmoothPlastic" | |
971 | block.Reflectance = 0.5 | |
972 | block.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
973 | local bv = Instance.new("IntValue", block) | |
974 | bv.Name = "goingUp" | |
975 | bv.Value = 0 | |
976 | else | |
977 | hole:findFirstChild("BLOCK").goingUp.Value = hole:findFirstChild("BLOCK").goingUp.Value + 1 | |
978 | if hole:findFirstChild("BLOCK").goingUp.Value <= 6 then | |
979 | local currentC = hole:findFirstChild("BLOCK").CFrame | |
980 | hole:findFirstChild("BLOCK").Size = hole:findFirstChild("BLOCK").Size + Vector3.new(0,5,0) | |
981 | hole:findFirstChild("BLOCK").CFrame = currentC*CFrame.new(0,-2.5,0) | |
982 | elseif hole:findFirstChild("BLOCK").goingUp.Value >= 20 and hole:findFirstChild("BLOCK").Size.Y > 0.3 then | |
983 | local currentC = hole:findFirstChild("BLOCK").CFrame | |
984 | hole:findFirstChild("BLOCK").Size = hole:findFirstChild("BLOCK").Size + Vector3.new(0,-5,0) | |
985 | hole:findFirstChild("BLOCK").CFrame = currentC*CFrame.new(0,2.5,0) | |
986 | elseif hole:findFirstChild("BLOCK").goingUp.Value == 7 then | |
987 | takeDamage((hole.Position - Vector3.new(0,30,0)), 30, 14, false) | |
988 | local e = Instance.new("Explosion", hole) | |
989 | e.Position = (hole.Position - Vector3.new(0,30,0)) | |
990 | e.BlastPressure = 100000 | |
991 | e.BlastRadius = 6 | |
992 | e.ExplosionType = "CratersAndDebris" | |
993 | e.Visible = false | |
994 | local spike = Instance.new("Part", model) | |
995 | table.insert(TSTable, spike) | |
996 | spike.Size = Vector3.new(0,0,0) | |
997 | spike.Name = "SlamRing" | |
998 | spike.Material = "Neon" | |
999 | spike.BrickColor = BrickColor.new("Industrial white") | |
1000 | spike.Anchored = true | |
1001 | spike.Transparency = 0.3 | |
1002 | spike.CanCollide = false | |
1003 | spike.CFrame = hole.CFrame*CFrame.new(0,-30,0)*CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) | |
1004 | local spikemesh = Instance.new("SpecialMesh", spike) | |
1005 | spikemesh.Name = "SpikeMesh" | |
1006 | spikemesh.Scale = Vector3.new(10,10,10) | |
1007 | spikemesh.MeshId = "http://www.roblox.com/asset/?id=3270017" | |
1008 | for ind = 1,8 do | |
1009 | local pgrass = Instance.new("Part",model) | |
1010 | pgrass.CanCollide = true | |
1011 | pgrass.Name = "GRASS" | |
1012 | pgrass.Anchored = true | |
1013 | if workspace:findFirstChild("Base") ~= nil then | |
1014 | pgrass.Material = workspace.Base.Material | |
1015 | pgrass.BrickColor = workspace.Base.BrickColor | |
1016 | else | |
1017 | pgrass.Material = "Grass" | |
1018 | pgrass.BrickColor = BrickColor.new("Bright green") | |
1019 | end | |
1020 | pgrass.Size = Vector3.new(math.random(8,10),math.random(1,2),math.random(8,10)) | |
1021 | pgrass.CFrame = hole.CFrame*CFrame.new(0,-30,0)*CFrame.Angles(math.rad(math.random(-40,40)),0,math.rad(math.random(-40,40))) | |
1022 | pgrass.CFrame = CFrame.new(hole.CFrame.X, hole.CFrame.Y-30, hole.CFrame.Z) --Start at the center of the circle | |
1023 | * CFrame.Angles(0, math.rad(ind*(360/8)), math.rad(0)) --Rotate the brick | |
1024 | * CFrame.new(0, 0, 6) --Move it out by 10 units | |
1025 | * CFrame.Angles(math.rad(math.random(-35,25)),math.rad(math.random(-10,10)),math.rad(math.random(-10,10))) | |
1026 | table.insert(TSTable, pgrass) | |
1027 | end | |
1028 | local s = Instance.new("Sound", pgrass) | |
1029 | s.SoundId = "rbxassetid://301184111" | |
1030 | s.EmitterSize = 10 | |
1031 | s.Volume = 0.3 | |
1032 | s:Play() | |
1033 | game:GetService("Debris"):AddItem(s, 5) | |
1034 | elseif hole:findFirstChild("BLOCK").goingUp.Value >= 30 then | |
1035 | hole:findFirstChild("BLOCK").Transparency = 1 | |
1036 | hole.HoleMesh.Scale = hole.HoleMesh.Scale - Vector3.new(10,0,10) | |
1037 | if hole.HoleMesh.Scale.X < 0 then | |
1038 | table.remove(holeTable, i) | |
1039 | hole:Remove() | |
1040 | end | |
1041 | end | |
1042 | end | |
1043 | end | |
1044 | end | |
1045 | end | |
1046 | if #SpinTable > 0 then | |
1047 | for i,v in pairs(SpinTable) do | |
1048 | if v.Transparency <= 1 then | |
1049 | if v.Name == "spinnything" then | |
1050 | v.Transparency = v.Transparency + 0.005 | |
1051 | v.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1052 | pcall(function() | |
1053 | v.SpikeMesh.Scale = v.SpikeMesh.Scale + Vector3.new(1,0,1) | |
1054 | end) | |
1055 | elseif v.Name == "firework" then | |
1056 | v.Transparency = v.Transparency + 0.01 | |
1057 | v.BrickColor = BrickColor.new(Rainbow[math.random(1,#Rainbow)]) | |
1058 | local sizeup = 3 | |
1059 | pcall(function() | |
1060 | v.SpikeMesh.Scale = v.SpikeMesh.Scale + Vector3.new(sizeup,sizeup,sizeup) | |
1061 | end) | |
1062 | elseif v.Name == "firework1" then | |
1063 | v.Transparency = v.Transparency + math.random(7,10)/1000 | |
1064 | v.BrickColor = BrickColor.new(Rainbow[math.random(1,#Rainbow)]) | |
1065 | local sizeup = math.random(2,5)/10 | |
1066 | pcall(function() | |
1067 | v.SpikeMesh.Scale = v.SpikeMesh.Scale + Vector3.new(sizeup,sizeup,sizeup) | |
1068 | end) | |
1069 | elseif v.Name == "teleball" then | |
1070 | v.Transparency = v.Transparency - 0.1 | |
1071 | v.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1072 | local sizeup = 4 | |
1073 | pcall(function() | |
1074 | v.SpikeMesh.Scale = v.SpikeMesh.Scale + Vector3.new(sizeup,sizeup,sizeup) | |
1075 | end) | |
1076 | elseif v.Name == "teleballsmall" then | |
1077 | v.Transparency = v.Transparency + 0.02 | |
1078 | v.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1079 | local sizeup = -1 | |
1080 | pcall(function() | |
1081 | v.SpikeMesh.Scale = v.SpikeMesh.Scale + Vector3.new(sizeup,sizeup,sizeup) | |
1082 | end) | |
1083 | elseif v.Name == "transRainbowPart" then | |
1084 | v.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1085 | v.Transparency = v.Transparency + 0.05 | |
1086 | else | |
1087 | v.Transparency = v.Transparency + 0.005 | |
1088 | v.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1089 | pcall(function() | |
1090 | v.SpikeMesh.Scale = v.SpikeMesh.Scale + Vector3.new(1,1,1) | |
1091 | end) | |
1092 | end | |
1093 | else | |
1094 | v:Remove() | |
1095 | table.remove(SpinTable, i) | |
1096 | end | |
1097 | end | |
1098 | end | |
1099 | if #projectiles > 0 then | |
1100 | for i,v in pairs(projectiles) do | |
1101 | if (v.Position - rootpart.Position).magnitude > 300 then | |
1102 | v:Remove() | |
1103 | table.remove(projectiles, i) | |
1104 | local ball1 = Instance.new("Part", model) | |
1105 | ball1.Size = Vector3.new(0,0,0) | |
1106 | ball1.Name = "firework" | |
1107 | ball1.Material = "Neon" | |
1108 | ball1.BrickColor = BrickColor.new(MainColor) | |
1109 | ball1.Anchored = true | |
1110 | ball1.Transparency = 0 | |
1111 | ball1.CanCollide = false | |
1112 | ball1.CFrame = CFrame.new(v.Position.x,v.Position.y,v.Position.z) | |
1113 | local spikemesh = Instance.new("SpecialMesh", ball1) | |
1114 | spikemesh.Name = "SpikeMesh" | |
1115 | spikemesh.MeshType = "Sphere" | |
1116 | spikemesh.Scale = Vector3.new(5,5,5) | |
1117 | table.insert(SpinTable,ball1) | |
1118 | local s = Instance.new("Sound", ball1) --Crackle | |
1119 | s.SoundId = "rbxassetid://435195821" | |
1120 | s.EmitterSize = 100 | |
1121 | s.Volume = 0.6 | |
1122 | s:Play() | |
1123 | game:GetService("Debris"):AddItem(s, 2) | |
1124 | local s = Instance.new("Sound", ball1) --boom | |
1125 | s.SoundId = "rbxassetid://514867425" | |
1126 | s.EmitterSize = 100 | |
1127 | s.Volume = 100 | |
1128 | s:Play() | |
1129 | game:GetService("Debris"):AddItem(s, 2) | |
1130 | game:GetService("RunService").Stepped:wait() | |
1131 | for i = 1,12 do --THIS IS A GOOD POINT | |
1132 | local p = Instance.new("Part",ball1) | |
1133 | p.Name = "firework" | |
1134 | p.Size = Vector3.new(0,0,0) | |
1135 | p.Transparency = 0 | |
1136 | p.CanCollide = true | |
1137 | p.CFrame = ball1.CFrame*CFrame.new(math.random(-4,4),i,math.random(-4,4)) | |
1138 | p.Material = "Neon" | |
1139 | p.BrickColor = BrickColor.new(Rainbow[i]) | |
1140 | local f = Instance.new("Fire",p) | |
1141 | f.Color = BrickColor.new(Rainbow[i]).Color | |
1142 | f.SecondaryColor = Color3.new(1,1,1) | |
1143 | local spikemesh = Instance.new("BlockMesh", p) | |
1144 | spikemesh.Name = "SpikeMesh" | |
1145 | spikemesh.Scale = Vector3.new(20,20,20) | |
1146 | table.insert(TSTable, p) | |
1147 | end | |
1148 | wait(0.1) | |
1149 | local e = Instance.new("Explosion", ball1) | |
1150 | e.Position = ball1.Position | |
1151 | e.BlastPressure = 100000 | |
1152 | e.BlastRadius = 20 | |
1153 | e.ExplosionType = "CratersAndDebris" | |
1154 | else | |
1155 | v.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1156 | local somethingWasHit = false | |
1157 | local Region = CreateRegion3FromLocAndSize(v.Position, Vector3.new(1,1,1)) | |
1158 | for _,Part in pairs(workspace:FindPartsInRegion3WithIgnoreList(Region,{char},math.huge)) do | |
1159 | if not somethingWasHit and Part.Name ~= "firework" and Part.Name ~= "firework1" and Part.Name ~= "projectile" and Part.Name ~= "Particle" then | |
1160 | somethingWasHit = true | |
1161 | v:Remove() | |
1162 | table.remove(projectiles, i) | |
1163 | takeDamage(v.Position, math.random(10,20), 13, false) | |
1164 | for i = 1,6 do | |
1165 | local ball = Instance.new("Part", model) | |
1166 | ball.Size = Vector3.new(0,0,0) | |
1167 | ball.Name = "firework1" | |
1168 | ball.Material = "Neon" | |
1169 | ball.BrickColor = BrickColor.new(MainColor) | |
1170 | ball.Anchored = true | |
1171 | ball.Transparency = 0.5 | |
1172 | ball.CanCollide = false | |
1173 | if i == 1 then | |
1174 | ball.CFrame = CFrame.new(v.Position.x,v.Position.y,v.Position.z) | |
1175 | ball.Transparency = 0 | |
1176 | else | |
1177 | ball.CFrame = CFrame.new(v.Position.x+math.random(-3,3),(v.Position.y+math.random(-3,3)),v.Position.z+math.random(-3,3)) | |
1178 | end | |
1179 | local spikemesh = Instance.new("SpecialMesh", ball) | |
1180 | spikemesh.Name = "SpikeMesh" | |
1181 | spikemesh.MeshType = "Sphere" | |
1182 | spikemesh.Scale = Vector3.new(1,1,1) | |
1183 | table.insert(SpinTable,ball) | |
1184 | if i == 1 then | |
1185 | local s = Instance.new("Sound", ball) | |
1186 | s.SoundId = "rbxassetid://435195821" | |
1187 | s.EmitterSize = 20 | |
1188 | s.Volume = 0.5 | |
1189 | s:Play() | |
1190 | game:GetService("Debris"):AddItem(s, 5) | |
1191 | local s = Instance.new("Sound", ball) --boom | |
1192 | s.SoundId = "rbxassetid://540926687" | |
1193 | s.EmitterSize = 50 | |
1194 | s.Volume = 1 | |
1195 | s:Play() | |
1196 | game:GetService("Debris"):AddItem(s, 3) | |
1197 | end | |
1198 | end | |
1199 | end | |
1200 | end | |
1201 | end | |
1202 | pcall(function() | |
1203 | v.CFrame = v.CFrame*CFrame.new(0,0,-3) | |
1204 | end) | |
1205 | end | |
1206 | end | |
1207 | if rainbowMode then | |
1208 | Mana = 100 | |
1209 | ManaBar.BackgroundColor3 = BrickColor.new(Rainbow[rainbowNumber]).Color | |
1210 | HealthBar.BackgroundColor3 = BrickColor.new(Rainbow[rainbowNumber]).Color | |
1211 | Info.TextColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1212 | Q.TextColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1213 | E.TextColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1214 | for i,v in pairs(char:GetChildren()) do | |
1215 | if v:isA("Part") then | |
1216 | v.Transparency = 1 | |
1217 | local cp = v:Clone() | |
1218 | cp.CanCollide = false | |
1219 | cp.Anchored = true | |
1220 | cp.Material = "SmoothPlastic" | |
1221 | cp.Transparency = 0 | |
1222 | cp.BrickColor = BrickColor.new(Rainbow[rainbowNumber]) | |
1223 | cp.CFrame = v.CFrame --*CFrame.new(0,0,0)*CFrame.Angles(math.rad(math.random(-20,20)),math.rad(math.random(-20,20)),math.rad(math.random(-20,20))) | |
1224 | for _,extra in pairs(cp:GetChildren()) do | |
1225 | if not extra:isA("SpecialMesh") then | |
1226 | extra:Remove() | |
1227 | end | |
1228 | end | |
1229 | if v.Name ~= "Head" then | |
1230 | local mesh = Instance.new("BlockMesh") | |
1231 | mesh.Parent = cp | |
1232 | mesh.Scale = Vector3.new(1,1,1) | |
1233 | end | |
1234 | cp.Parent = model | |
1235 | table.insert(bodyparts, cp) | |
1236 | end | |
1237 | end | |
1238 | end | |
1239 | if #bodyparts > 0 then | |
1240 | for i,v in pairs(bodyparts) do | |
1241 | if v.Transparency < 1 then | |
1242 | v.Transparency = v.Transparency + 0.05 | |
1243 | --v.Mesh.Scale = v.Mesh.Scale-Vector3.new(0.05,0.05,0.05) | |
1244 | else | |
1245 | table.remove(bodyparts, i) | |
1246 | v:Remove() | |
1247 | end | |
1248 | end | |
1249 | end | |
1250 | if rainbowNumber >= #Rainbow then | |
1251 | rainbowNumber = 1 | |
1252 | else | |
1253 | rainbowNumber = rainbowNumber + 1 | |
1254 | end | |
1255 | end) | |
1256 | ||
1257 | local wtap = false | |
1258 | Mouse.KeyDown:connect(function(key) | |
1259 | if key:lower() == "q" then | |
1260 | spellMover = spells[#spells] | |
1261 | table.remove(spells, #spells) | |
1262 | table.insert(spells, 1, spellMover) | |
1263 | loadSpellGui() | |
1264 | elseif key:lower() == "e" then | |
1265 | spellMover = spells[1] | |
1266 | table.remove(spells, 1) | |
1267 | table.insert(spells, #spells+1, spellMover) | |
1268 | loadSpellGui() | |
1269 | end | |
1270 | if not inAction then | |
1271 | if key:lower() == "w" then | |
1272 | if wtap then | |
1273 | if Mana > 0 then | |
1274 | holdingw = true | |
1275 | inAction = true | |
1276 | isCharging = true | |
1277 | char.Humanoid.WalkSpeed = 0 | |
1278 | char.Humanoid.JumpPower = 0 | |
1279 | actionWalking = false | |
1280 | currentAnim = "DashDown" | |
1281 | local dashs = Instance.new("Sound", torso) --whole opening | |
1282 | dashs.SoundId = "rbxassetid://551066808" --ADD DASHING SOUND | |
1283 | dashs.EmitterSize = 12 | |
1284 | dashs.Volume = 100 | |
1285 | dashs.Looped = true | |
1286 | dashs:Play() | |
1287 | wait(0.2) | |
1288 | isCharging = false | |
1289 | takeDamage(rootpart.Position, math.random(20,30), 10, false) | |
1290 | char.Humanoid.WalkSpeed = 1 | |
1291 | currentAnim = "Dashing" | |
1292 | if holdingw then | |
1293 | repeat wait() until not holdingw | |
1294 | else | |
1295 | wait(0.3) | |
1296 | end | |
1297 | dashs:Remove() | |
1298 | currentAnim = "DashSlowing" | |
1299 | slowingDown = 1 | |
1300 | wait(0.5) | |
1301 | char.Humanoid.JumpPower = jumpPower | |
1302 | wtap = false | |
1303 | actionWalking = true | |
1304 | inAction = false | |
1305 | char.Humanoid.WalkSpeed = CharacterSpeed | |
1306 | end | |
1307 | else | |
1308 | wtap = true | |
1309 | wait(0.2) | |
1310 | wtap = false | |
1311 | end | |
1312 | end | |
1313 | end | |
1314 | end) | |
1315 | Mouse.KeyUp:connect(function(key) | |
1316 | if key:lower() == "w" then | |
1317 | holdingw = false | |
1318 | end | |
1319 | end) | |
1320 | Mouse.Button1Down:connect(function() | |
1321 | holdingMouse1 = true | |
1322 | if not inAction then | |
1323 | if Mana >= currentSpell.ManaCost then | |
1324 | Mana = Mana - currentSpell.ManaCost | |
1325 | if currentSpell.Name == "Firework" then | |
1326 | inAction = true | |
1327 | currentAnim = "ArmUp" | |
1328 | wait(0.05) | |
1329 | currentAnim = "Slash1" | |
1330 | isCharging = true | |
1331 | wait(0.3) | |
1332 | currentAnim = "SlashMini" | |
1333 | wait(0.1) | |
1334 | currentAnim = "Slash2" | |
1335 | wait(0.08) | |
1336 | if holdingMouse1 then | |
1337 | repeat if Mana >= currentSpell.ManaCost then Mana = (Mana - currentSpell.ManaCost) else holdingMouse1 = false end OriginalProjectile(Mouse.Hit.p) wait(0.1) currentAnim = "SlashMini" wait(0.2) currentAnim = "Slash2" until not holdingMouse1 | |
1338 | else | |
1339 | OriginalProjectile(Mouse.Hit.p) | |
1340 | end | |
1341 | isCharging = false | |
1342 | inAction = false | |
1343 | elseif currentSpell.Name == "Void Crush" then | |
1344 | inAction = true | |
1345 | currentAnim = "Casting" | |
1346 | char.Humanoid.WalkSpeed = CharacterSpeed/1.5 | |
1347 | walkingAnimationSpeed = walkingAnimationSpeed*1.5 | |
1348 | castingStart(1) | |
1349 | wait(1) | |
1350 | currentAnim = "SlashMini" | |
1351 | wait(0.1) | |
1352 | currentAnim = "Slash2" | |
1353 | wait(0.08) | |
1354 | createHole(Mouse.Hit.p, 30) | |
1355 | char.Humanoid.WalkSpeed = CharacterSpeed | |
1356 | walkingAnimationSpeed = walkingAnimationSpeed/1.5 | |
1357 | isCharging = false | |
1358 | inAction = false | |
1359 | elseif currentSpell.Name == "Teleport" then | |
1360 | inAction = true | |
1361 | currentAnim = "Casting" | |
1362 | char.Humanoid.WalkSpeed = CharacterSpeed/1.5 | |
1363 | walkingAnimationSpeed = walkingAnimationSpeed*1.5 | |
1364 | castingStart(0.7) | |
1365 | wait(0.5) | |
1366 | if (torso.Position - Mouse.Hit.p).magnitude <= 3000 then | |
1367 | local tball1 = Instance.new("Part", model) | |
1368 | tball1.Size = Vector3.new(0,0,0) | |
1369 | tball1.Name = "teleball" | |
1370 | tball1.Material = "Neon" | |
1371 | tball1.BrickColor = BrickColor.new(MainColor) | |
1372 | tball1.Anchored = true | |
1373 | tball1.Transparency = 0.95 | |
1374 | tball1.CanCollide = false | |
1375 | tball1.CFrame = CFrame.new(Mouse.Hit.p.X, Mouse.Hit.p.Y+3, Mouse.Hit.p.Z) | |
1376 | local spikemesh = Instance.new("SpecialMesh", tball1) | |
1377 | spikemesh.Name = "SpikeMesh" | |
1378 | spikemesh.MeshType = "Sphere" | |
1379 | spikemesh.Scale = Vector3.new(1,1,1) | |
1380 | table.insert(SpinTable,tball1) | |
1381 | local tball = Instance.new("Part", model) | |
1382 | tball.Size = Vector3.new(0,0,0) | |
1383 | tball.Name = "teleball" | |
1384 | tball.Material = "Neon" | |
1385 | tball.BrickColor = BrickColor.new(MainColor) | |
1386 | tball.Anchored = false | |
1387 | tball.Transparency = 0.95 | |
1388 | tball.CanCollide = false | |
1389 | tball.CFrame = torso.CFrame | |
1390 | local spikemesh = Instance.new("SpecialMesh", tball) | |
1391 | spikemesh.Name = "SpikeMesh" | |
1392 | spikemesh.MeshType = "Sphere" | |
1393 | spikemesh.Scale = Vector3.new(1,1,1) | |
1394 | table.insert(SpinTable,tball) | |
1395 | local TWeld = Instance.new("Weld",tball) | |
1396 | TWeld.Part0 = tball | |
1397 | TWeld.Part1 = torso | |
1398 | TWeld.C0 = CFrame.new(0,0,0) | |
1399 | wait(0.1) | |
1400 | local s = Instance.new("Sound", torso) | |
1401 | s.SoundId = "rbxassetid://289556450" | |
1402 | s.EmitterSize = 5 | |
1403 | s.Volume = 1 | |
1404 | s:Play() | |
1405 | game:GetService("Debris"):AddItem(s, 3) | |
1406 | local laser2 = Instance.new("Part", model) | |
1407 | laser2.Color = BrickColor.White().Color | |
1408 | laser2.Transparency = 0.1 | |
1409 | laser2.Name = "transRainbowPart" | |
1410 | laser2.Material = "Neon" | |
1411 | laser2.Anchored = true | |
1412 | laser2.CanCollide = false | |
1413 | laser2.CFrame = CFrame.new(((tball.Position.X + tball1.Position.X) / 2), ((tball.Position.Y + tball1.Position.Y) / 2), ((tball.Position.Z + tball1.Position.Z) / 2)) | |
1414 | laser2.CFrame = CFrame.new(laser2.Position, tball1.Position) | |
1415 | laser2.Size = Vector3.new(0, 0, (tball.Position - tball1.Position).magnitude) | |
1416 | local bm = Instance.new("BlockMesh", laser2) | |
1417 | bm.Scale = Vector3.new(2, 2, 1) | |
1418 | table.insert(SpinTable,laser2) | |
1419 | wait(0.1) | |
1420 | TWeld:Remove() | |
1421 | tball.CFrame = torso.CFrame | |
1422 | tball.Anchored = true | |
1423 | tball.Name = "teleballsmall" | |
1424 | rootpart.CFrame = tball1.CFrame | |
1425 | tball1.Name = "teleballsmall" | |
1426 | end | |
1427 | char.Humanoid.WalkSpeed = CharacterSpeed | |
1428 | walkingAnimationSpeed = walkingAnimationSpeed/1.5 | |
1429 | isCharging = false | |
1430 | inAction = false | |
1431 | elseif currentSpell.Name == "True Form" then | |
1432 | inAction = true | |
1433 | currentAnim = "Casting" | |
1434 | char.Humanoid.WalkSpeed = CharacterSpeed/1.5 | |
1435 | walkingAnimationSpeed = walkingAnimationSpeed*1.5 | |
1436 | wait(3) | |
1437 | if rainbowMode then | |
1438 | rainbowMode = false | |
1439 | pcall(function() | |
1440 | rainbows:Remove() | |
1441 | end) | |
1442 | for i,v in pairs(char:GetChildren()) do | |
1443 | if v:isA("Part") then | |
1444 | if v.Name ~= "HumanoidRootPart" then | |
1445 | v.Transparency = 0 | |
1446 | end | |
1447 | elseif v:isA("Accessory") then | |
1448 | v.Handle.Transparency = 0 | |
1449 | end | |
1450 | end | |
1451 | CharacterSpeed = CharacterSpeed/2 | |
1452 | walkingAnimationSpeed = 3.5*1.5 | |
1453 | model.face.Parent = char.Head | |
1454 | ManaBar.BackgroundColor3 = Color3.new(0, 0.317647, 1) | |
1455 | HealthBar.BackgroundColor3 = Color3.new(0, 0.8, 0.02) | |
1456 | Info.TextColor = BrickColor.new(MainColor) | |
1457 | Q.TextColor = BrickColor.new(MainColor) | |
1458 | E.TextColor = BrickColor.new(MainColor) | |
1459 | else | |
1460 | for i,v in pairs(char:GetChildren()) do | |
1461 | if v:isA("Part") then | |
1462 | if v.Name ~= "HumanoidRootPart" then | |
1463 | v.Transparency = 1 | |
1464 | end | |
1465 | elseif v:isA("Accessory") then | |
1466 | v.Handle.Transparency = 1 | |
1467 | end | |
1468 | end | |
1469 | CharacterSpeed = CharacterSpeed*2 | |
1470 | walkingAnimationSpeed = 6*1.5 | |
1471 | char.Humanoid.WalkSpeed = CharacterSpeed | |
1472 | char.Head.face.Parent = model | |
1473 | rainbowMode = true | |
1474 | rainbows = Instance.new("Sound", torso) --whole opening | |
1475 | rainbows.SoundId = "rbxassetid://179794977" | |
1476 | rainbows.EmitterSize = 6 | |
1477 | rainbows.Volume = 100 | |
1478 | rainbows:Play() | |
1479 | rainbows.Looped = true | |
1480 | end | |
1481 | char.Humanoid.WalkSpeed = CharacterSpeed | |
1482 | walkingAnimationSpeed = walkingAnimationSpeed/1.5 | |
1483 | isCharging = false | |
1484 | inAction = false | |
1485 | end | |
1486 | else | |
1487 | print("Not enough mana") | |
1488 | end | |
1489 | end | |
1490 | end) | |
1491 | Mouse.Button1Up:connect(function() | |
1492 | holdingMouse1 = false | |
1493 | end) |