View difference between Paste ID: Cu88cUT3 and kZvdkfTx
SHOW: | | - or go back to the newest paste.
1
-- Player declarations
2-
local player = game.Players.Kronola
2+
local player = game.Players.megatron2006
3
local char = player.Character
4
-- Tool declarations
5-
-- Body parts
5+
6-
local torso = char.Torso
6+
7
8
-- Earth bending declarations
9
local raisingEarth = false
10
local raisingTower = false
11
local wall = false
12
local groundAttack = false
13
local lastTower = nil
14
local disabled = {}
15
local frames = {}
16
local parts = {}
17
local Taunts = {"Die already!", "DIE, DIE, DIE!", "HRRAAAA!", "I told you it's useless!", "You will not be the first to die by my hand!", "You will suffer!", "Don't try to evade the inevitable!", "I will tear you apart!","You are pathetic!","You will never defeat me!","I AM GOD!"}
18
local raisechats = {"I will make you realize the depth of my power, even if I have to grind your body into dust!","I suggest you run.", "Now you're just pissing me off.", "Hmph.", "It's useless.",".....", "Your life ends here!","Foolish!","Do you know who I am?","What stupidity.","Hmm.","Hmph. Your confidence is annoying.","You cannot kill a god."}
19
20
-- Main
21
function main(mouse)
22
while true do wait(1/30)
23
local look = CFrame.new(torso.Position, torso.Position + mouse.Hit.lookVector)
24
25
-- Reset parts
26
parts = {}
27
28
-- Get parts
29
for x = -20, 20, 10 do
30
for y = -20, 20, 10 do
31
for z = -30, -10, 10 do
32
local pos = look * Vector3.new(x, y, z)
33
getPartsInRegion3(
34
Region3.new(
35
pos + Vector3.new(1,1,1)*-9,
36
pos + Vector3.new(1,1,1)* 9
37
),
38
parts
39
)
40
end
41
end
42
end
43
44
-- Mouse down
45
if mouseDown then
46
-- Create dif and bodies
47
for _, part in pairs(parts) do
48
if part.Name == "Earth" and not disabled[part] then
49
if not frames[part] and part ~= lastTower then
50
frames[part] = look:toObjectSpace(part.CFrame)
51
52
part:ClearAllChildren()
53
part.Anchored = false
54
55
-- Create bodies
56
createBody("Position", part)
57
createBody("Gyro", part)
58
end
59
end
60
end
61
62
-- Move bodies
63
for part in pairs(frames) do
64
local bodyPos = part:FindFirstChild("BodyPosition")
65
local bodyGyr = part:FindFirstChild("BodyGyro")
66
67
-- Bodies exist
68
if bodyPos and bodyGyr then
69
local dif = look * frames[part]
70
71
bodyPos.position = dif.p
72
bodyGyr.cframe = dif
73
else
74
frames[part] = nil
75
end
76
end
77
else
78
for part in pairs(frames) do
79
if part.Name == "Earth" then
80
frames[part] = nil
81
82
part:ClearAllChildren()
83
end
84
end
85
end
86
end
87
end
88
89
-- On key change
90
function onKeyChange(mouse, key, state)
91
-- Raise earth
92
if key == "e" and state and not raisingEarth then
93
game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
94
raisingEarth = true
95
while keysDown[key] do
96
local torsoY = torso.Position.y + 3
97
local pos = planeY(torso.Position, 0.4 - 4/2)
98
local dir = planeY(mouse.Hit.lookVector).unit
99
local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
100
101
-- Create earth part
102
local part = createEarth(workspace)
103
part.Anchored = true
104
part.Size = Vector3.new(4, 4, 4)
105
disabled[part] = true
106
107
-- Raise earth
108
for i = 1, 4 do i = i/4
109
part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
110
wait(1/10000000)
111
if not part.Anchored then
112
break
113
end
114
end
115
116
disabled[part] = nil
117
part.Anchored = false
118
119
wait(1/100)
120
end
121
raisingEarth = false
122
123
124
125
126
127
elseif key == "c" and state and not raisingEarth then
128
game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
129
raisingEarth = true
130
while keysDown[key] do
131
local torsoY = torso.Position.y + 3
132
local pos = planeY(torso.Position, 0.4 - 4/2)
133
local dir = planeY(mouse.Hit.lookVector).unit
134
local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
135
136
-- Create earth part
137
local part = createEarth(workspace)
138
part.Anchored = true
139
part.Size = Vector3.new(2, 2, 2)
140
disabled[part] = true
141
142
-- Raise earth
143
for i = 1, 4 do i = i/4
144
part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
145
wait(1/10000000)
146
if not part.Anchored then
147
break
148
end
149
end
150
151
disabled[part] = nil
152
part.Anchored = false
153
154
wait(1/100)
155
end
156
raisingEarth = false
157
158
159
160
-- Push earth
161
elseif key == "f" and state then
162
game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
163
for _, part in pairs(parts) do
164
if part.Name == "Earth" and part ~= lastTower then
165
part:ClearAllChildren()
166
part.Anchored = false
167
168
-- Add force
169
local bodyForce = createBody("Force", part)
170
bodyForce.force = mouse.Hit.lookVector*1.5e4 * part:GetMass()
171
172
game.Debris:AddItem(bodyForce, 1/30)
173
174
-- Disable part
175
disabled[part] = true
176
delay(1, function()
177
disabled[part] = nil
178
end)
179
end
180
end
181
182
-- Monster Ability
183
elseif key == "m" and state then
184
wait(.1)
185
f = Instance.new("Fire")
186
f.Parent = char.Head
187
f.Color = Color3.new(10.7,20.5,30.9)
188
f.Size = 5
189
f.Heat = 5
190
wait(.1)
191-
f.Color = Color3.new(0.7,0.5,0.9)
191+
192
g.Parent = char["Right Arm"]
193
g.Color = Color3.new(20.7,10.5,30.9)
194
g.Size = 5
195
g.Heat = 5
196
wait(.1)
197-
g.Color = Color3.new(0.7,0.5,0.9)
197+
198
h.Parent = char["Left Arm"]
199
h.Color = Color3.new(10.7,50.5,60.9)
200
h.Size = 5
201
h.Heat = 5
202
wait(.1)
203-
h.Color = Color3.new(0.7,0.5,0.9)
203+
204
z.Parent = game.Workspace
205
z.SoundId = "http://www.roblox.com/asset/?id=285098599"
206
z.Looped = false
207
z.Volume = 100
208
z.Pitch = 0.8
209-
z.SoundId = "http://www.roblox.com/asset/?id=159365911"
209+
210
game:GetService("Chat"):Chat(char.Head, "Hmph.", Enum.ChatColor.Red)
211-
z.Volume = 1
211+
212-
z.Pitch = 0.65
212+
213
wait(2.4)
214
game:GetService("Chat"):Chat(char.Head, "I will end this quickly", Enum.ChatColor.Red)
215
wait(.1)
216
z:Play()
217
char.Humanoid.MaxHealth = 900000000
218
wait(1)
219
char.Humanoid.Health = 900000000
220
wait(182)
221
char.Humanoid.MaxHealth = 600
222
z:Remove()
223
f:Remove()
224
g:Remove()
225
h:Remove()
226
227
-- N-Rage
228
elseif key == "n" and state then
229
c = Instance.new("Sound")
230
c.Parent = game.Workspace
231
c.SoundId = "http://www.roblox.com/asset/?id=157747165"
232
c.Looped = false
233
c.Volume = 1
234
c.Pitch = .7
235
wait(1.8)
236
game:GetService("Chat"):Chat(char.Head, "What the hell was that?", Enum.ChatColor.Red)
237
wait(2)
238
game:GetService("Chat"):Chat(char.Head, "Did you actually believe you could harm me?", Enum.ChatColor.Red)
239
wait(2.4)
240
game:GetService("Chat"):Chat(char.Head, "If you would simply let yourself die, you would not have to go through this pointless suffering.", Enum.ChatColor.Red)
241
wait(3.5)
242
game:GetService("Chat"):Chat(char.Head, "All you have done is waste my time.", Enum.ChatColor.Red)
243
wait(.1)
244
c:Play()
245
char.Humanoid.MaxHealth = math.huge
246
wait(160)
247
char.Humanoid.MaxHealth = 10000
248
c:Remove()
249
250
-- Break earth
251
elseif key == "b" and state then
252
game:GetService("Chat"):Char(char.Head, "Hmph.", Enum.ChatColor.Red)
253
wait(.01)
254
for part in pairs(frames) do
255
if part.Size == Vector3.new(4, 4, 4) then
256
for x = -1, 2, 2 do
257
for y = -1, 2, 2 do
258
for z = -1, 1, 2 do
259
local oPart = createEarth(workspace)
260
oPart.Size = Vector3.new(2, 2, 2)
261
oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
262
end
263
end
264
end
265
part:Destroy()
266
end
267
268
end
269
270
for part in pairs(frames) do
271
if part.Size == Vector3.new(25, 15, 25) then
272
for x = -3, 2, 2 do
273
for y = -3, 2, 2 do
274
for z = -3, 1, 2 do
275
local oPart = createEarth(workspace)
276
oPart.Size = Vector3.new(2, 2, 2)
277
oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
278
end
279
end
280
end
281
part:Destroy()
282
end
283
284
end
285
286
for part in pairs(frames) do
287
if part.Size == Vector3.new(2, 2, 2) then
288
for x = -0.5, 2, 2 do
289
for y = -0.5, 2, 2 do
290
for z = -0.5, 1, 2 do
291
local oPart = createEarth(workspace)
292
oPart.Size = Vector3.new(1, 1, 1)
293
oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
294
end
295
end
296
end
297
part:Destroy()
298
end
299
300
end
301
302
303
304
305
-- Raise tower
306
elseif key == "r" and state and not raisingTower then
307
game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
308
raisingTower = true
309
lastTower = nil
310
if torso.Position.y - 5/2 < 20.4 then
311
local part = createEarth(workspace)
312
part.Anchored = true
313
disabled[part] = true
314
315
for i = 0, 20, 4 do
316
part.Size = Vector3.new(5, i, 5)
317
part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
318
torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
319
wait(1/30)
320
end
321
322
lastTower = part
323
324
disabled[part] = nil
325
part.Anchored = false
326
end
327
raisingTower = false
328
329
330
-- Raise wall
331
elseif key == "t" and state and not wall then
332
game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
333
wall = true
334
lastWall = nil
335
if torso.Position.y - 5/2 < 20.4 then
336
local part = createEarth(workspace)
337
part.Anchored = true
338
disabled[part] = true
339
340
for i = 0, 1, 20 do
341
part.Size = Vector3.new(25, 15, 25)
342
part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
343
torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
344
wait(1/30)
345
end
346
347
lastWall = part
348
349
disabled[part] = nil
350
part.Anchored = false
351
end
352
wall = false
353
354
-- Ground attack
355
elseif key == "g" and state and not groundAttack then
356
game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
357
groundAttack = true
358
delay(1, function()
359
groundAttack = false
360
end)
361
362
local dir = planeY(mouse.Hit.p - torso.Position).unit
363
local pos = planeY(torso.Position, 0.4 + 1) + dir*5
364
365
local ground = {}
366
367
delay(5, function()
368
for i = 1, 20 do
369
for _, part in pairs(ground) do
370
if part.Anchored then
371
part.CFrame = part.CFrame + Vector3.new(0, -1/7, 0)
372
end
373
end
374
wait(1/30)
375
end
376
for _, part in pairs(ground) do
377
if part.Anchored then
378
part:Destroy()
379
end
380
end
381
end)
382
383
for i = 1, 10 do
384
local hit, pos2 = rayCast(pos, dir*5, {char})
385
386
local part = createEarth(workspace)
387
part.Anchored = true
388
part.Size = Vector3.new(4, 4, 4)
389
part.CFrame = CFrame.new(pos2, pos2 + dir) * CFrame.Angles(math.rad(-50), 0, 0) + Vector3.new(0, -0, 0)
390
391
ground[#ground + 1] = part
392
393
-- Add force
394
if hit then
395
local mass = hit:GetMass()
396
397
-- Hit player
398
for _, oPlayer in pairs(game.Players:GetPlayers()) do
399
if oPlayer.Character and oPlayer.Character:FindFirstChild("Torso") and hit:IsDescendantOf(oPlayer.Character) then
400
hit = oPlayer.Character.Torso
401
mass = 20
402
end
403
end
404
405
if hit.Name ~= "Torso" then
406
hit:ClearAllChildren()
407
end
408
hit.Anchored = false
409
410
-- Add force
411
local bodyForce = createBody("Force", hit)
412
bodyForce.force = (dir + Vector3.new(0, 0.2, 0)).unit*1e4 * mass
413
414
game.Debris:AddItem(bodyForce, 1/30)
415
break
416
end
417
418
pos = pos2
419
wait(1/20)
420
end
421
end
422
end
423
424
--- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
425
--- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
426
--- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
427
428
-- Clear old tool
429
player.Backpack:ClearAllChildren()
430
431
-- Create tool
432
local tool = Instance.new("HopperBin")
433
tool.Parent = player.Backpack
434
tool.Name = "Kronola's Custom"
435
436
-- Tool selected
437
tool.Selected:connect(function(mouse)
438
mouse.Icon = "rbxasset://textures\\GunCursor.png"
439
440
-- Mouse events
441
mouse.Button1Down:connect(function()
442
mouseDown = true
443
end)
444
mouse.Button1Up:connect(function()
445
mouseDown = false
446
end)
447
mouse.KeyDown:connect(function(key)
448
keysDown[key:lower()] = true
449
onKeyChange(mouse, key:lower(), true)
450
end)
451
mouse.KeyUp:connect(function(key)
452
keysDown[key:lower()] = false
453
onKeyChange(mouse, key:lower(), false)
454
end)
455
456
-- Call main
457
main(mouse)
458
end)
459
460
--- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
461
--- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
462
--- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
463
464
-- Ray cast
465
function rayCast(pos, dir, ignore)
466
return workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, dir), ignore)
467
end
468
469
-- Create body
470
function createBody(type, path)
471
local body = Instance.new("Body" .. type)
472
if type == "Gyro" then
473
body.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
474
elseif type ~= "Force" then
475
body.maxForce = Vector3.new(math.huge, math.huge, math.huge)
476
end
477
body.Parent = path
478
return body
479
end
480
481
-- Get parts in region 3
482
function getPartsInRegion3(region, parts)
483
repeat
484
local regParts = workspace:FindPartsInRegion3WithIgnoreList(region, parts, 100)
485
for i, part in pairs(regParts) do
486
parts[#parts + 1] = part
487
end
488
until #regParts < 100
489
end
490
491
-- Random
492
function r(min, max)
493
return math.random()*(max - min) + min
494
end
495
496
-- Plane y
497
function planeY(v, y)
498
return Vector3.new(v.x, y or 0, v.z)
499
end
500
501
-- Create earth
502
function createEarth(path)
503
local part = createPart("Earth", path)
504
part.BrickColor = BrickColor.new("Really cyan")
505
part.Material = "Ice"
506
m = Instance.new("Fire",part)
507
m.Heat = 10
508-
part.BrickColor = BrickColor.new("Really black")
508+
509-
part.Material = "Slate"
509+
510
end
511
512
-- Create part
513
function createPart(name, path)
514
local part = Instance.new("Part")
515
part.FormFactor = "Symmetric"
516
part.BottomSurface = "Smooth"
517
part.TopSurface = "Smooth"
518
part.Size = Vector3.new(1, 1, 1)
519
part.Name = name
520
part.Parent = path
521
return part
522
end