View difference between Paste ID: zzf4ZAqW and kZvdkfTx
SHOW: | | - or go back to the newest paste.
1-
-- Player declarations
1+
2-
local player = game.Players.Kronola
2+
3-
local char = player.Character
3+
4
-- Raise earth
5-
-- Body parts
5+
6-
local torso = char.Torso
6+
7
wait(1/10000000)
8-
-- Tool declarations
8+
9-
local mouseDown = false
9+
10-
local keysDown = {}
10+
11
end
12-
-- Earth bending declarations
12+
13-
local raisingEarth = false
13+
14-
local raisingTower = false
14+
15-
local wall = false
15+
16-
local groundAttack = false
16+
17-
local lastTower = nil
17+
18-
local disabled = {}
18+
19-
local frames = {}
19+
20-
local parts = {}
20+
21-
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!"}
21+
22-
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."}
22+
23
24-
-- Main
24+
25-
function main(mouse)
25+
26-
while true do wait(1/30)
26+
27-
local look = CFrame.new(torso.Position, torso.Position + mouse.Hit.lookVector)
27+
28
local torsoY = torso.Position.y + 3
29-
-- Reset parts
29+
30-
parts = {}
30+
31
local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
32-
-- Get parts
32+
33-
for x = -20, 20, 10 do
33+
34-
for y = -20, 20, 10 do
34+
35-
for z = -30, -10, 10 do
35+
36-
local pos = look * Vector3.new(x, y, z)
36+
37-
getPartsInRegion3(
37+
38-
Region3.new(
38+
39-
pos + Vector3.new(1,1,1)*-9,
39+
40-
pos + Vector3.new(1,1,1)* 9
40+
41-
),
41+
42-
parts
42+
43-
)
43+
44
break
45
end
46
end
47
48-
-- Mouse down
48+
49-
if mouseDown then
49+
50-
-- Create dif and bodies
50+
51
wait(1/100)
52-
if part.Name == "Earth" and not disabled[part] then
52+
53-
if not frames[part] and part ~= lastTower then
53+
54-
frames[part] = look:toObjectSpace(part.CFrame)
54+
55
56
57
-- Push earth
58
elseif key == "f" and state then
59-
-- Create bodies
59+
60-
createBody("Position", part)
60+
61-
createBody("Gyro", part)
61+
62
part:ClearAllChildren()
63
part.Anchored = false
64
65
-- Add force
66-
-- Move bodies
66+
67
bodyForce.force = mouse.Hit.lookVector*1.5e4 * part:GetMass()
68-
local bodyPos = part:FindFirstChild("BodyPosition")
68+
69-
local bodyGyr = part:FindFirstChild("BodyGyro")
69+
70
71-
-- Bodies exist
71+
72-
if bodyPos and bodyGyr then
72+
73-
local dif = look * frames[part]
73+
74
disabled[part] = nil
75-
bodyPos.position = dif.p
75+
76-
bodyGyr.cframe = dif
76+
77-
else
77+
78-
frames[part] = nil
78+
79
-- Monster Ability
80
elseif key == "m" and state then
81-
else
81+
82
f = Instance.new("Fire")
83-
if part.Name == "Earth" then
83+
84-
frames[part] = nil
84+
f.Color = Color3.new(0.8,0.4,0)
85
f.Size = 5
86
f.Heat = 5
87
wait(.1)
88
g = Instance.new("Fire")
89
g.Parent = char["Right Arm"]
90
g.Color = Color3.new(0.8,0.4,0)
91
g.Size = 5
92
g.Heat = 5
93-
-- On key change
93+
94-
function onKeyChange(mouse, key, state)
94+
95
h.Parent = char["Left Arm"]
96-
if key == "e" and state and not raisingEarth then
96+
h.Color = Color3.new(0.8,0.4,0)
97
h.Size = 5
98
h.Heat = 5
99
wait(.1)
100
z = Instance.new("Sound")
101
z.Parent = game.Workspace
102
z.SoundId = "http://www.roblox.com/asset/?id=410533850"
103
z.Looped = True
104
z.Volume = 10
105
z.Pitch = 1
106
wait(1.8)
107
game:GetService("Chat"):Chat(char.Head, "Hmph.", Enum.ChatColor.Red)
108
wait(3.4)
109
game:GetService("Chat"):Chat(char.Head, "This has become a pointless battle.", Enum.ChatColor.Red)
110
wait(2.4)
111
game:GetService("Chat"):Chat(char.Head, "I will end this quickly", Enum.ChatColor.Red)
112
wait(.1)
113
z:Play()
114
char.Humanoid.MaxHealth = 9999999999999999999
115
wait(1)
116
char.Humanoid.Health = 9999999999999999999
117
wait(182)
118
char.Humanoid.MaxHealth = 9999999999999999999
119
z:Remove()
120
f:Remove()
121
g:Remove()
122
h:Remove()
123
124
-- N-Rage
125
elseif key == "n" and state then
126
c = Instance.new("Sound")
127
c.Parent = game.Workspace
128
c.Looped = false
129
c.Volume = 1
130
c.Pitch = .7
131
wait(1.8)
132
game:GetService("Chat"):Chat(char.Head, "What the hell was that?", Enum.ChatColor.Red)
133
wait(2)
134
game:GetService("Chat"):Chat(char.Head, "Did you actually believe you could harm me?", Enum.ChatColor.Red)
135
wait(2.4)
136
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)
137
wait(3.5)
138
game:GetService("Chat"):Chat(char.Head, "All you have done is waste my time.", Enum.ChatColor.Red)
139
wait(.1)
140
c:Play()
141
char.Humanoid.MaxHealth = 9999999999999999999
142
wait(160)
143
char.Humanoid.MaxHealth = 9999999999999999999
144
c:Remove()
145
146
-- Break earth
147
elseif key == "b" and state then
148
game:GetService("Chat"):Char(char.Head, "Hmph.", Enum.ChatColor.Red)
149
wait(.01)
150
for part in pairs(frames) do
151
if part.Size == Vector3.new(4, 4, 4) then
152
for x = -1, 2, 2 do
153
for y = -1, 2, 2 do
154
for z = -1, 1, 2 do
155
local oPart = createEarth(workspace)
156
oPart.Size = Vector3.new(2, 2, 2)
157
oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
158
end
159
end
160
end
161
part:Destroy()
162
end
163
164
end
165
166
for part in pairs(frames) do
167
if part.Size == Vector3.new(25, 15, 25) then
168
for x = -3, 2, 2 do
169
for y = -3, 2, 2 do
170
for z = -3, 1, 2 do
171
local oPart = createEarth(workspace)
172
oPart.Size = Vector3.new(2, 2, 2)
173
oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
174
end
175
end
176
end
177
part:Destroy()
178
end
179
180
end
181
182
for part in pairs(frames) do
183
if part.Size == Vector3.new(2, 2, 2) then
184
for x = -0.5, 2, 2 do
185
for y = -0.5, 2, 2 do
186
for z = -0.5, 1, 2 do
187
local oPart = createEarth(workspace)
188
oPart.Size = Vector3.new(1, 1, 1)
189
oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
190
end
191-
f.Color = Color3.new(0.7,0.5,0.9)
191+
192
end
193
part:Destroy()
194
end
195
196
end
197-
g.Color = Color3.new(0.7,0.5,0.9)
197+
198
199
200
201
-- Raise tower
202
elseif key == "r" and state and not raisingTower then
203-
h.Color = Color3.new(0.7,0.5,0.9)
203+
204
raisingTower = true
205
lastTower = nil
206
if torso.Position.y - 5/2 < 20.4 then
207
local part = createEarth(workspace)
208
part.Anchored = true
209-
z.SoundId = "http://www.roblox.com/asset/?id=159365911"
209+
210-
z.Looped = false
210+
211-
z.Volume = 1
211+
212-
z.Pitch = 0.65
212+
213
part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
214
torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
215
wait(1/30)
216
end
217
218
lastTower = part
219
220
disabled[part] = nil
221-
char.Humanoid.MaxHealth = 900000000
221+
222
end
223-
char.Humanoid.Health = 900000000
223+
224
225-
char.Humanoid.MaxHealth = 600
225+
226
-- Raise wall
227
elseif key == "t" and state and not wall then
228
game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
229
wall = true
230
lastWall = nil
231
if torso.Position.y - 5/2 < 20.4 then
232
local part = createEarth(workspace)
233
part.Anchored = true
234
disabled[part] = true
235-
c.SoundId = "http://www.roblox.com/asset/?id=157747165"
235+
236
for i = 0, 1, 20 do
237
part.Size = Vector3.new(25, 15, 25)
238
part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
239
torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
240
wait(1/30)
241
end
242
243
lastWall = part
244
245
disabled[part] = nil
246
part.Anchored = false
247
end
248
wall = false
249-
char.Humanoid.MaxHealth = math.huge
249+
250
-- Ground attack
251-
char.Humanoid.MaxHealth = 10000
251+
252
game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
253
groundAttack = true
254
delay(1, function()
255
groundAttack = false
256
end)
257
258
local dir = planeY(mouse.Hit.p - torso.Position).unit
259
local pos = planeY(torso.Position, 0.4 + 1) + dir*5
260
261
local ground = {}
262
263
delay(5, function()
264
for i = 1, 20 do
265
for _, part in pairs(ground) do
266
if part.Anchored then
267
part.CFrame = part.CFrame + Vector3.new(0, -1/7, 0)
268
end
269
end
270
wait(1/30)
271
end
272
for _, part in pairs(ground) do
273
if part.Anchored then
274
part:Destroy()
275
end
276
end
277
end)
278
279
for i = 1, 10 do
280
local hit, pos2 = rayCast(pos, dir*5, {char})
281
282
local part = createEarth(workspace)
283
part.Anchored = true
284
part.Size = Vector3.new(4, 4, 4)
285
part.CFrame = CFrame.new(pos2, pos2 + dir) * CFrame.Angles(math.rad(-50), 0, 0) + Vector3.new(0, -0, 0)
286
287
ground[#ground + 1] = part
288
289
-- Add force
290
if hit then
291
local mass = hit:GetMass()
292
293
-- Hit player
294
for _, oPlayer in pairs(game.Players:GetPlayers()) do
295
if oPlayer.Character and oPlayer.Character:FindFirstChild("Torso") and hit:IsDescendantOf(oPlayer.Character) then
296
hit = oPlayer.Character.Torso
297
mass = 20
298
end
299
end
300
301
if hit.Name ~= "Torso" then
302
hit:ClearAllChildren()
303
end
304
hit.Anchored = false
305
306
-- Add force
307
local bodyForce = createBody("Force", hit)
308
bodyForce.force = (dir + Vector3.new(0, 0.2, 0)).unit*1e4 * mass
309
310
game.Debris:AddItem(bodyForce, 1/30)
311
break
312
end
313
314
pos = pos2
315
wait(1/20)
316
end
317
end
318
end
319
320
--- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
321
--- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
322
--- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
323
324
-- Clear old tool
325
player.Backpack:ClearAllChildren()
326
327
-- Create tool
328
local tool = Instance.new("HopperBin")
329
tool.Parent = player.Backpack
330
tool.Name = "Iron's earth powers"
331
332
-- Tool selected
333
tool.Selected:connect(function(mouse)
334
mouse.Icon = "rbxasset://textures\\GunCursor.png"
335
336
-- Mouse events
337
mouse.Button1Down:connect(function()
338
mouseDown = true
339
end)
340
mouse.Button1Up:connect(function()
341
mouseDown = false
342
end)
343
mouse.KeyDown:connect(function(key)
344
keysDown[key:lower()] = true
345
onKeyChange(mouse, key:lower(), true)
346
end)
347
mouse.KeyUp:connect(function(key)
348
keysDown[key:lower()] = false
349
onKeyChange(mouse, key:lower(), false)
350
end)
351
352
-- Call main
353
main(mouse)
354
end)
355
356
--- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
357
--- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
358
--- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
359
360
-- Ray cast
361
function rayCast(pos, dir, ignore)
362
return workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, dir), ignore)
363
end
364
365
-- Create body
366
function createBody(type, path)
367
local body = Instance.new("Body" .. type)
368
if type == "Gyro" then
369
body.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
370
elseif type ~= "Force" then
371
body.maxForce = Vector3.new(math.huge, math.huge, math.huge)
372
end
373
body.Parent = path
374
return body
375
end
376
377
-- Get parts in region 3
378
function getPartsInRegion3(region, parts)
379
repeat
380
local regParts = workspace:FindPartsInRegion3WithIgnoreList(region, parts, 100)
381
for i, part in pairs(regParts) do
382
parts[#parts + 1] = part
383
end
384
until #regParts < 100
385
end
386
387
-- Random
388
function r(min, max)
389
return math.random()*(max - min) + min
390
end
391
392
-- Plane y
393
function planeY(v, y)
394
return Vector3.new(v.x, y or 0, v.z)
395
end
396
397
-- Create earth
398
function createEarth(path)
399
local part = createPart("Earth", path)
400
part.BrickColor = BrickColor.new("Earth orange")
401
part.Material = "Slate"
402
m = Instance.new("Fire",part)
403
m.Heat = 10
404
part.Parent = path
405
return part
406
end
407
408
-- Create part
409
function createPart(name, path)
410
local part = Instance.new("Part")
411
part.FormFactor = "Symmetric"
412
part.BottomSurface = "Smooth"
413
part.TopSurface = "Smooth"
414
part.Size = Vector3.new(1, 1, 1)
415
part.Name = name
416
part.Parent = path
417
return part
418
end