SHOW:
|
|
- or go back to the newest paste.
1 | - | wait(.5) |
1 | + | --https://github.com/Mokiros/roblox-FE-compatibility |
2 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
3 | local Player,game,owner = owner,game | |
4 | local RealPlayer = Player | |
5 | do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end wait(.5) | |
6 | plr = game.Players.LocalPlayer | |
7 | chr = plr.Character or plr.CharacterAdded:wait() | |
8 | renderstepped = game:GetService('RunService').RenderStepped | |
9 | mouse = plr:GetMouse() | |
10 | userinput = game:GetService('UserInputService') | |
11 | myhum = chr.Humanoid | |
12 | torso = chr.Torso | |
13 | pi = math.pi | |
14 | huge = math.huge | |
15 | part = Instance.new('Part') | |
16 | part.TopSurface = 'Smooth' | |
17 | part.BottomSurface = 'Smooth' | |
18 | typing = false | |
19 | myhum.MaxHealth = 2500 | |
20 | wait() | |
21 | myhum.Health = 2500 | |
22 | attacking = false | |
23 | defending = false | |
24 | head = chr.Head | |
25 | torso.Anchored = true | |
26 | chr.Animate.Disabled = true | |
27 | cframeval = head.CFrame | |
28 | bloodpart = part:Clone() | |
29 | bloodpart.CanCollide = false | |
30 | bloodpart.Anchored = true | |
31 | bloodpart.Shape = Enum.PartType.Ball | |
32 | bloodpart.Size = Vector3.new(.4,.4,.4) | |
33 | bloodpart.Transparency = .8 | |
34 | bloodpart.Material = Enum.Material.Neon | |
35 | bloodpart.BrickColor = BrickColor.Red() | |
36 | local bbgui = Instance.new('BillboardGui',bloodpart) | |
37 | bbgui.StudsOffset = Vector3.new(0,.5,0) | |
38 | bbgui.Enabled = true | |
39 | bbgui.Size = UDim2.new(0,50,0,25) | |
40 | local tlabel = Instance.new('TextLabel',bbgui) | |
41 | tlabel.BackgroundTransparency = 0 | |
42 | tlabel.BackgroundColor3 = Color3.fromRGB(192, 57, 43) | |
43 | tlabel.BorderSizePixel = 0 | |
44 | tlabel.TextColor3 = Color3.new(1,1,1) | |
45 | tlabel.Font = Enum.Font.Legacy | |
46 | tlabel.Size = UDim2.new(0,50,0,25) | |
47 | filtered = Instance.new('Model') | |
48 | mouse.TargetFilter = filtered | |
49 | floating = true | |
50 | ---------------------------------------------------------------------------------- | |
51 | function floatynigga() | |
52 | local cframeval = head.CFrame | |
53 | while floating do | |
54 | for i = 0,1,0.01 do | |
55 | if floating then | |
56 | renderstepped:wait() | |
57 | chr:SetPrimaryPartCFrame(cframeval:lerp(cframeval*CFrame.new(0,15,0),i)) | |
58 | else | |
59 | break | |
60 | end | |
61 | end | |
62 | local cframeval = head.CFrame | |
63 | for i = 0,1,0.01 do | |
64 | if floating then | |
65 | renderstepped:wait() | |
66 | chr:SetPrimaryPartCFrame(cframeval:lerp(cframeval*CFrame.new(0,-15,0),i)) | |
67 | else | |
68 | break | |
69 | end | |
70 | end | |
71 | end | |
72 | end | |
73 | for i = 0,1,.025 do | |
74 | renderstepped:wait() | |
75 | chr:SetPrimaryPartCFrame(head.CFrame:lerp(cframeval*CFrame.new(0,10,0),i)) | |
76 | end | |
77 | spawn(floatynigga) | |
78 | ||
79 | function bloodcframeB(random,torso,humanoid) | |
80 | if random ~= 0 then | |
81 | local clone = bloodpart:Clone() | |
82 | clone.BillboardGui.TextLabel.Text = random | |
83 | clone.CFrame = torso.Parent:FindFirstChild('Torso').CFrame*CFrame.new(math.random(-3,3),math.random(-3,3),math.random(-3,3)) | |
84 | clone.Parent = torso | |
85 | humanoid:TakeDamage(random) | |
86 | for i = 1,.5,-.01 do | |
87 | renderstepped:wait() | |
88 | clone.Transparency = i | |
89 | clone.BillboardGui.TextLabel.Transparency = i | |
90 | clone.CFrame = clone.CFrame*CFrame.new(0,.01,0) | |
91 | end | |
92 | wait(1) | |
93 | for i = .5,1,.01 do | |
94 | renderstepped:wait() | |
95 | clone.Transparency = i | |
96 | clone.BillboardGui.TextLabel.Transparency = i | |
97 | clone.CFrame = clone.CFrame*CFrame.new(0,.01,0) | |
98 | end | |
99 | clone:Destroy() | |
100 | end | |
101 | end | |
102 | ||
103 | function transparencyanim(part,a,b,speed,neg) | |
104 | if not neg then | |
105 | for i = a,b,speed do | |
106 | renderstepped:wait() | |
107 | part.Transparency = i | |
108 | end | |
109 | else | |
110 | for i = a,b,speed do | |
111 | renderstepped:wait() | |
112 | part.Transparency = i | |
113 | end | |
114 | end | |
115 | end | |
116 | ||
117 | function plerp(part,startpoint,endpoint,speed,canclone,clonepart,clonepartcframe,transpeed) | |
118 | for i = 0,1,speed do | |
119 | renderstepped:wait() | |
120 | part.CFrame = startpoint:lerp(endpoint,i) | |
121 | if canclone then | |
122 | local clone = clonepart:Clone() | |
123 | clone.CFrame = clone.CFrame*CFrame.Angles(math.random(-180,180),math.random(-180,180),math.random(-180,180)) | |
124 | clone:ClearAllChildren() | |
125 | clone.Anchored = true | |
126 | clone.CanCollide = false | |
127 | clone.Parent = workspace | |
128 | local function tran() | |
129 | for i = 0,1,transpeed do | |
130 | renderstepped:wait() | |
131 | clone.Transparency = i | |
132 | end | |
133 | clone:Destroy() | |
134 | end | |
135 | spawn(tran) | |
136 | end | |
137 | end | |
138 | end | |
139 | --transparencyanim(part,a,b,speed,neg) | |
140 | function circle(point,rad,val,hollow,parent,part,a,b,speed,neg,destroy) | |
141 | local diameter = rad*2 | |
142 | local circ = diameter*pi | |
143 | local n = circ/val | |
144 | local rot = 360/n | |
145 | if hollow then | |
146 | for i = 0,n do | |
147 | renderstepped:wait() | |
148 | local clone = part:Clone() | |
149 | clone.Touched:connect(function(part) | |
150 | if destroy and part and part.Parent then | |
151 | part:Destroy() | |
152 | end | |
153 | end) | |
154 | local function trananim() | |
155 | clone.Parent = parent | |
156 | transparencyanim(part,a,b,speed,neg) | |
157 | end | |
158 | clone.CFrame = point*CFrame.Angles(0,math.rad(i*n),0)*CFrame.new(rad,0,0) | |
159 | spawn(trananim) | |
160 | end | |
161 | else | |
162 | for i = 0,n/2 do | |
163 | renderstepped:wait() | |
164 | local clone = part:Clone() | |
165 | clone.Touched:connect(function(part) | |
166 | if destroy and part and part.Parent then | |
167 | part:Destroy() | |
168 | end | |
169 | end) | |
170 | local function trananim() | |
171 | clone.Parent = parent | |
172 | transparencyanim(part,a,b,speed,neg) | |
173 | end | |
174 | clone.CFrame = point*CFrame.Angles(0,math.rad(i*n),0) | |
175 | spawn(trananim) | |
176 | end | |
177 | end | |
178 | end | |
179 | ||
180 | mouse.Button1Down:connect(function() | |
181 | if typing then | |
182 | typing = false | |
183 | end | |
184 | end) | |
185 | ---------------------------------------------------------------------------------- | |
186 | ||
187 | userinput.InputBegan:connect(function(k) | |
188 | local key = k.KeyCode | |
189 | if key == Enum.KeyCode.Slash or key == Enum.KeyCode.Quote then | |
190 | typing = true | |
191 | elseif | |
192 | key == Enum.KeyCode.Return then | |
193 | typing = false | |
194 | elseif not typing then | |
195 | if key == Enum.KeyCode.W and not defending then | |
196 | defending = true | |
197 | local group = Instance.new('Model') | |
198 | group.Parent = workspace.Terrain | |
199 | local shield = part:Clone() | |
200 | local start = head.CFrame | |
201 | shield.Material = Enum.Material.Neon | |
202 | shield.Size = Vector3.new(.5,50,.5) | |
203 | shield.Anchored = false | |
204 | shield.Transparency = 1 | |
205 | shield.BrickColor = BrickColor.new(0,0,0) | |
206 | for i = -12.5,13,.5 do | |
207 | renderstepped:wait() | |
208 | local clone = shield:Clone() | |
209 | local function trananim() | |
210 | transparencyanim(clone,1,.1,-.02,true) | |
211 | end | |
212 | clone.Touched:connect(function(part) | |
213 | if part and part.Parent then | |
214 | local humanoid = part.Parent:FindFirstChild('Humanoid') | |
215 | local velocity = part:FindFirstChild('BodyVelocity') | |
216 | if humanoid and humanoid ~= myhum then | |
217 | bloodcframeB(math.random(5,15),part.Parent.Torso,humanoid) | |
218 | elseif velocity then | |
219 | velocity.Velocity = velocity.Velocity*-1 | |
220 | elseif part.Name ~= 'Base' and part.Parent ~= group and part.Parent ~= chr and part.Parent.Parent ~= chr then | |
221 | part:Destroy() | |
222 | end | |
223 | end | |
224 | end) | |
225 | local function lerp() | |
226 | spawn(trananim) | |
227 | clone.Parent = group | |
228 | plerp(clone,start*CFrame.new(math.random(-25,25),math.random(30,50),math.random(-25,-5)),start*CFrame.new(i,0,-5),.01,false) | |
229 | clone.Anchored = true | |
230 | clone.CFrame = start*CFrame.new(i,0,-5) | |
231 | end | |
232 | spawn(lerp) | |
233 | end | |
234 | userinput.InputEnded:connect(function(keycode) | |
235 | if keycode.KeyCode == Enum.KeyCode.W then | |
236 | local children = group:GetChildren() | |
237 | for _,v in pairs(children) do | |
238 | renderstepped:wait() | |
239 | local start = v.CFrame | |
240 | local function trananim() | |
241 | transparencyanim(v,0,1,.025,false) | |
242 | end | |
243 | local function lerp() | |
244 | spawn(trananim) | |
245 | plerp(v,start,start*CFrame.new(0,-50,0),.01) | |
246 | end | |
247 | spawn(lerp) | |
248 | end | |
249 | defending = false | |
250 | wait(1) | |
251 | group:Destroy() | |
252 | end | |
253 | end) | |
254 | elseif key == Enum.KeyCode.A and not defending then | |
255 | defending = true | |
256 | local group = Instance.new('Model') | |
257 | group.Parent = workspace.Terrain | |
258 | local shield = part:Clone() | |
259 | local start = head.CFrame | |
260 | shield.Material = Enum.Material.Neon | |
261 | shield.Size = Vector3.new(.5,50,.5) | |
262 | shield.Anchored = false | |
263 | shield.Transparency = 1 | |
264 | shield.BrickColor = BrickColor.new(0,0,0) | |
265 | for i = -12.5,13,.5 do | |
266 | renderstepped:wait() | |
267 | local clone = shield:Clone() | |
268 | local function trananim() | |
269 | transparencyanim(clone,1,.1,-.02,true) | |
270 | end | |
271 | clone.Touched:connect(function(part) | |
272 | if part and part.Parent then | |
273 | local humanoid = part.Parent:FindFirstChild('Humanoid') | |
274 | local velocity = part:FindFirstChild('BodyVelocity') | |
275 | if humanoid and humanoid ~= myhum then | |
276 | bloodcframeB(math.random(5,15),part.Parent.Torso,humanoid) | |
277 | elseif velocity then | |
278 | velocity.Velocity = velocity.Velocity*-1 | |
279 | elseif part.Name ~= 'Base' and part.Parent ~= group and part.Parent ~= chr and part.Parent.Parent ~= chr then | |
280 | part:Destroy() | |
281 | end | |
282 | end | |
283 | end) | |
284 | local function lerp() | |
285 | spawn(trananim) | |
286 | clone.Parent = group | |
287 | plerp(clone,start*CFrame.Angles(0,math.rad(90),0)*CFrame.new(math.random(-25,25),math.random(30,50),math.random(-25,-5)),start*CFrame.Angles(0,math.rad(90),0)*CFrame.new(i,0,-5),.01,false) | |
288 | clone.Anchored = true | |
289 | clone.CFrame = start*CFrame.Angles(0,math.rad(90),0)*CFrame.new(i,0,-5) | |
290 | end | |
291 | spawn(lerp) | |
292 | end | |
293 | userinput.InputEnded:connect(function(keycode) | |
294 | if keycode.KeyCode == Enum.KeyCode.A then | |
295 | local children = group:GetChildren() | |
296 | for _,v in pairs(children) do | |
297 | renderstepped:wait() | |
298 | local start = v.CFrame | |
299 | local function trananim() | |
300 | transparencyanim(v,0,1,.025,false) | |
301 | end | |
302 | local function lerp() | |
303 | spawn(trananim) | |
304 | plerp(v,start,start*CFrame.new(0,-50,0),.01) | |
305 | end | |
306 | spawn(lerp) | |
307 | end | |
308 | defending = false | |
309 | wait(1) | |
310 | group:Destroy() | |
311 | end | |
312 | end) | |
313 | elseif key == Enum.KeyCode.D and not defending then | |
314 | defending = true | |
315 | local group = Instance.new('Model') | |
316 | group.Parent = workspace.Terrain | |
317 | local shield = part:Clone() | |
318 | local start = head.CFrame | |
319 | shield.Material = Enum.Material.Neon | |
320 | shield.Size = Vector3.new(.5,50,.5) | |
321 | shield.Anchored = false | |
322 | shield.Transparency = 1 | |
323 | shield.BrickColor = BrickColor.new(0,0,0) | |
324 | for i = -12.5,13,.5 do | |
325 | renderstepped:wait() | |
326 | local clone = shield:Clone() | |
327 | local function trananim() | |
328 | transparencyanim(clone,1,.1,-.02,true) | |
329 | end | |
330 | clone.Touched:connect(function(part) | |
331 | if part and part.Parent then | |
332 | local humanoid = part.Parent:FindFirstChild('Humanoid') | |
333 | local velocity = part:FindFirstChild('BodyVelocity') | |
334 | if humanoid and humanoid ~= myhum then | |
335 | bloodcframeB(math.random(5,15),part.Parent.Torso,humanoid) | |
336 | elseif velocity then | |
337 | velocity.Velocity = velocity.Velocity*-1 | |
338 | elseif part.Name ~= 'Base' and part.Parent ~= group and part.Parent ~= chr and part.Parent.Parent ~= chr then | |
339 | part:Destroy() | |
340 | end | |
341 | end | |
342 | end) | |
343 | local function lerp() | |
344 | spawn(trananim) | |
345 | clone.Parent = group | |
346 | plerp(clone,start*CFrame.Angles(0,math.rad(-90),0)*CFrame.new(math.random(-25,25),math.random(30,50),math.random(-25,-5)),start*CFrame.Angles(0,math.rad(-90),0)*CFrame.new(i,0,-5),.01,false) | |
347 | clone.Anchored = true | |
348 | clone.CFrame = start*CFrame.Angles(0,math.rad(-90),0)*CFrame.new(i,0,-5) | |
349 | end | |
350 | spawn(lerp) | |
351 | end | |
352 | userinput.InputEnded:connect(function(keycode) | |
353 | if keycode.KeyCode == Enum.KeyCode.D then | |
354 | local children = group:GetChildren() | |
355 | for _,v in pairs(children) do | |
356 | renderstepped:wait() | |
357 | local start = v.CFrame | |
358 | local function trananim() | |
359 | transparencyanim(v,0,1,.025,false) | |
360 | end | |
361 | local function lerp() | |
362 | spawn(trananim) | |
363 | plerp(v,start,start*CFrame.new(0,-50,0),.01) | |
364 | end | |
365 | spawn(lerp) | |
366 | end | |
367 | defending = false | |
368 | wait(1) | |
369 | group:Destroy() | |
370 | end | |
371 | end) | |
372 | elseif key == Enum.KeyCode.S and not defending then | |
373 | defending = true | |
374 | local group = Instance.new('Model') | |
375 | group.Parent = workspace.Terrain | |
376 | local shield = part:Clone() | |
377 | local start = head.CFrame | |
378 | shield.Material = Enum.Material.Neon | |
379 | shield.Size = Vector3.new(.5,50,.5) | |
380 | shield.Anchored = false | |
381 | shield.Transparency = 1 | |
382 | shield.BrickColor = BrickColor.new(0,0,0) | |
383 | for i = -12.5,13,.5 do | |
384 | renderstepped:wait() | |
385 | local clone = shield:Clone() | |
386 | local function trananim() | |
387 | transparencyanim(clone,1,.1,-.02,true) | |
388 | end | |
389 | clone.Touched:connect(function(part) | |
390 | if part and part.Parent then | |
391 | local humanoid = part.Parent:FindFirstChild('Humanoid') | |
392 | local velocity = part:FindFirstChild('BodyVelocity') | |
393 | if humanoid and humanoid ~= myhum then | |
394 | bloodcframeB(math.random(5,15),part.Parent.Torso,humanoid) | |
395 | elseif velocity then | |
396 | velocity.Velocity = velocity.Velocity*-1 | |
397 | elseif part.Name ~= 'Base' and part.Parent ~= group and part.Parent ~= chr and part.Parent.Parent ~= chr then | |
398 | part:Destroy() | |
399 | end | |
400 | end | |
401 | end) | |
402 | local function lerp() | |
403 | spawn(trananim) | |
404 | clone.Parent = group | |
405 | plerp(clone,start*CFrame.new(math.random(-25,25),math.random(30,50),math.random(5,25)),start*CFrame.new(i,0,5),.01,false) | |
406 | clone.Anchored = true | |
407 | clone.CFrame = start*CFrame.new(i,0,5) | |
408 | end | |
409 | spawn(lerp) | |
410 | end | |
411 | userinput.InputEnded:connect(function(keycode) | |
412 | if keycode.KeyCode == Enum.KeyCode.S then | |
413 | local children = group:GetChildren() | |
414 | for _,v in pairs(children) do | |
415 | renderstepped:wait() | |
416 | local start = v.CFrame | |
417 | local function trananim() | |
418 | transparencyanim(v,0,1,.025,false) | |
419 | end | |
420 | local function lerp() | |
421 | spawn(trananim) | |
422 | plerp(v,start,start*CFrame.new(0,-50,0),.01) | |
423 | end | |
424 | spawn(lerp) | |
425 | end | |
426 | defending = false | |
427 | wait(1) | |
428 | group:Destroy() | |
429 | end | |
430 | end) | |
431 | elseif key == Enum.KeyCode.Space and not defending then | |
432 | defending = true | |
433 | local template = part:Clone() | |
434 | local group = Instance.new('Model',workspace.Terrain) | |
435 | template.Material = Enum.Material.Neon | |
436 | template.Size = Vector3.new(.75,14,.75) | |
437 | template.CanCollide = false | |
438 | template.Anchored = true | |
439 | template.Color = Color3.fromRGB(128, 187, 219) | |
440 | template.Transparency = 1 | |
441 | local rad = 7 | |
442 | local circ = pi*rad*2 | |
443 | local n = circ/.75 | |
444 | local rot = 360/n | |
445 | floating = false | |
446 | local start = torso.CFrame | |
447 | for i = 0,n/2 do | |
448 | renderstepped:wait() | |
449 | for x = 0,n/2 do | |
450 | local clone = template:Clone() | |
451 | local function transanim() | |
452 | transparencyanim(clone,1,.9,-.005,true) | |
453 | end | |
454 | clone.Touched:connect(function(part) | |
455 | if part and part.Parent then | |
456 | local humanoid = part.Parent:FindFirstChild('Humanoid') | |
457 | local velocity = part:FindFirstChild('BodyVelocity') | |
458 | if humanoid and humanoid ~= myhum then | |
459 | bloodcframeB(math.random(5,10),part.Parent.Torso,humanoid) | |
460 | humanoid.Sit = true | |
461 | humanoid.PlatfornStand = true | |
462 | elseif velocity then | |
463 | velocity.Velocity = velocity.Velocity*-1 | |
464 | elseif part.Name ~= 'Base' and part.Parent ~= group and part.Parent ~= chr and part.Parent.Parent ~= chr then | |
465 | part:Destroy() | |
466 | end | |
467 | end | |
468 | end) | |
469 | clone.CFrame = start*CFrame.Angles(math.rad(x*rot),0,math.rad(i*rot))*CFrame.new(0,rad,0) | |
470 | local function lerp() | |
471 | clone.Parent = group | |
472 | plerp(clone,clone.CFrame,clone.CFrame*CFrame.new(0,-rad,0),.05) | |
473 | clone.CFrame = start*CFrame.Angles(math.rad(x*rot),0,math.rad(i*rot)) | |
474 | end | |
475 | spawn(lerp) | |
476 | spawn(transanim) | |
477 | end | |
478 | end | |
479 | userinput.InputEnded:connect(function(keycode) | |
480 | if keycode.KeyCode == Enum.KeyCode.Space and defending then | |
481 | defending = false | |
482 | local children = group:GetChildren() | |
483 | for _,v in pairs(children) do | |
484 | local function destroy() | |
485 | transparencyanim(v,.9,1,.01,false) | |
486 | v:Destroy() | |
487 | end | |
488 | spawn(destroy) | |
489 | end | |
490 | floating = true | |
491 | cframeval = head.CFrame | |
492 | spawn(floatynigga) | |
493 | end | |
494 | wait(4) | |
495 | group:Destroy() | |
496 | end) | |
497 | elseif key == Enum.KeyCode.Q and not attacking then | |
498 | attacking = true | |
499 | local sword = Instance.new('Model') | |
500 | local group = Instance.new('Model') | |
501 | local blade = Instance.new('Part') | |
502 | blade.Anchored = false | |
503 | blade.CanCollide = false | |
504 | blade.Color = Color3.new(0,0,0) | |
505 | blade.Material = Enum.Material.SmoothPlastic | |
506 | blade.Size = Vector3.new(.2,5,.2) | |
507 | blade.CFrame = CFrame.new(0,0,0) | |
508 | blade.Parent = sword | |
509 | local hilt = blade:Clone() | |
510 | hilt.Parent = sword | |
511 | hilt.CFrame = CFrame.new(0,1.8,0) | |
512 | hilt.Size = Vector3.new(1,.2,.2) | |
513 | local sphere = part:Clone() | |
514 | sphere.Material = Enum.Material.Neon | |
515 | sphere.CanCollide = false | |
516 | sphere.Anchored = true | |
517 | sphere.Color = Color3.new(0,0,0) | |
518 | sphere.Size = Vector3.new(.2,.2,.2) | |
519 | sphere.Shape = 'Ball' | |
520 | local val = head.CFrame*CFrame.new(0,45,0) | |
521 | sphere.CFrame = val | |
522 | sphere.Parent = group | |
523 | sword.PrimaryPart = blade | |
524 | group.Parent = workspace.Terrain | |
525 | local function shoot() | |
526 | local clone = sword:Clone() | |
527 | clone.PrimaryPart.Touched:connect(function(part) | |
528 | if part and part.Parent then | |
529 | local h = part.Parent:FindFirstChild('Humanoid') | |
530 | if h and h ~= myhum then | |
531 | h.Sit = true | |
532 | bloodcframeB(math.random(25,50),h.Parent.Torso,h) | |
533 | end | |
534 | end | |
535 | end) | |
536 | local randomA = math.random(10,30) | |
537 | local randomB = math.random() | |
538 | local randomC = math.random(10,30) | |
539 | local randomD = math.random() | |
540 | if randomB>=.5 then | |
541 | randomA = randomA*-1 | |
542 | elseif randomD>=.5 then | |
543 | randomC = randomC*-1 | |
544 | end | |
545 | clone:SetPrimaryPartCFrame(val*CFrame.Angles(math.rad(randomA),math.rad(math.random(0,360)),math.rad(randomC))) | |
546 | local valB = clone.PrimaryPart.CFrame | |
547 | clone.Parent = group | |
548 | for i = 0,1,.05 do | |
549 | renderstepped:wait() | |
550 | clone:SetPrimaryPartCFrame(valB:lerp(valB*CFrame.new(0,-120,0),i)) | |
551 | end | |
552 | end | |
553 | for i = .2,10,.25 do | |
554 | renderstepped:wait() | |
555 | sphere.Size = Vector3.new(i,i,i) | |
556 | for i = 1,2 do | |
557 | spawn(shoot) | |
558 | end | |
559 | end | |
560 | attacking = false | |
561 | wait(2) | |
562 | for i = 0,1,.1 do | |
563 | renderstepped:wait() | |
564 | sphere.Transparency = i | |
565 | sphere.Size = sphere.Size+Vector3.new(.25,.25,.25) | |
566 | end | |
567 | wait(3) | |
568 | group:Destroy() | |
569 | elseif key == Enum.KeyCode.Z and not attacking then | |
570 | attacking = true | |
571 | local group = Instance.new('Model') | |
572 | local earth = part:Clone() | |
573 | earth.Color = Color3.fromRGB(40, 127, 71) | |
574 | earth.CanCollide = true | |
575 | earth.Anchored = true | |
576 | earth.Size = Vector3.new(5,5,5) | |
577 | earth.Material = Enum.Material.Grass | |
578 | group.ChildAdded:connect(function(part) | |
579 | part.Touched:connect(function(human) | |
580 | if part and part.Parent then | |
581 | local h = human.Parent:FindFirstChild('Humanoid') | |
582 | if h and h ~= myhum then | |
583 | h.Sit = true | |
584 | bloodcframeB(math.random(7,13),h.Parent.Torso,h) | |
585 | end | |
586 | end | |
587 | end) | |
588 | part.CFrame = part.CFrame*CFrame.Angles(math.random(0,360),math.random(0,360),math.random(0,360)) | |
589 | end) | |
590 | center = head.CFrame | |
591 | group.Parent = workspace.Terrain | |
592 | for i = 20,75,3 do | |
593 | renderstepped:wait() | |
594 | local function bend() | |
595 | local rad = i | |
596 | local circ = pi*rad*2 | |
597 | local n = circ/3 | |
598 | local rot = 360/n | |
599 | for x = 0,n do | |
600 | local clone = earth:Clone() | |
601 | clone.CFrame = CFrame.new(center.X,0,center.Z)*CFrame.Angles(0,math.rad(x*rot),0)*CFrame.new(rad,0,0) | |
602 | clone.Parent = group | |
603 | end | |
604 | end | |
605 | spawn(bend) | |
606 | end | |
607 | attacking = false | |
608 | group.PrimaryPart = group.Part | |
609 | group.PrimaryPart.CanCollide = false | |
610 | wait() | |
611 | group.PrimaryPart.Rotation = Vector3.new(0,0,0) | |
612 | wait(1) | |
613 | for i = 0,20 do | |
614 | renderstepped:wait() | |
615 | group:SetPrimaryPartCFrame(group.PrimaryPart.CFrame*CFrame.new(0,-.5,0)) | |
616 | end | |
617 | group:Destroy() | |
618 | end | |
619 | end | |
620 | end) | |
621 | --earthbend infront of you using math.sin() or cos | |
622 | --plerp(part,startpoint,endpoint,speed,canclone,clonepart,clonepartcframe,transpeed) | |
623 | --transparencyanim(part,a,b,speed,neg) | |
624 | --circle(point,rad,val,hollow,parent,part,a,b,speed,neg,destroy) | |
625 | --wasd = gfhj or rety |