View difference between Paste ID: PuFtXXvz and 5LEuDMuf
SHOW: | | - or go back to the newest paste.
1
function sandbox(var,func)
2
	local env = getfenv(func)
3
	local newenv = setmetatable({},{
4
		__index = function(self,k)
5
			if k=="script" then
6
				return var
7
			else
8
				return env[k]
9
			end
10
		end,
11
	})
12
	setfenv(func,newenv)
13
	return func
14
end
15
cors = {}
16
mas = Instance.new("Model",game:GetService("Lighting"))
17
Tool0 = Instance.new("Tool")
18
LocalScript1 = Instance.new("LocalScript")
19
Part2 = Instance.new("Part")
20
Sound3 = Instance.new("Sound")
21
SpecialMesh4 = Instance.new("SpecialMesh")
22
Script5 = Instance.new("Script")
23
Script6 = Instance.new("Script")
24
Tool0.Name = "BanHammer"
25
Tool0.Parent = mas
26
Tool0.GripPos = Vector3.new(0, -1.29999995, 0)
27
LocalScript1.Name = "Local Gui"
28
LocalScript1.Parent = Tool0
29
Part2.Name = "Handle"
30
Part2.Parent = Tool0
31
Part2.BrickColor = BrickColor.new("Dark stone grey")
32
Part2.Rotation = Vector3.new(-0.0799999982, 86.1999969, 90.0799942)
33
Part2.RotVelocity = Vector3.new(0.00102792226, -0.000492732797, -0.00233189948)
34
Part2.Velocity = Vector3.new(0.00164371042, -0.00827400293, -0.000668970461)
35
Part2.FormFactor = Enum.FormFactor.Symmetric
36
Part2.Size = Vector3.new(1, 4, 2)
37
Part2.CFrame = CFrame.new(-33.9286079, 0.891649067, 7.43305969, -8.98174985e-05, -0.0663281381, 0.997797906, 1, 2.43193026e-05, 9.1587659e-05, -3.04132845e-05, 0.997797906, 0.0663281009)
38
Part2.BottomSurface = Enum.SurfaceType.Smooth
39
Part2.TopSurface = Enum.SurfaceType.Smooth
40
Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
41
Part2.Position = Vector3.new(-33.9286079, 0.891649067, 7.43305969)
42
Part2.Orientation = Vector3.new(-0.00999999978, 86.1999969, 90)
43
Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
44
Sound3.Name = "Boom"
45
Sound3.Parent = Part2
46
Sound3.SoundId = "rbxasset://sounds/Rocket shot.wav"
47
Sound3.Volume = 1
48
SpecialMesh4.Parent = Part2
49
SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=10604848"
50
SpecialMesh4.Scale = Vector3.new(0.5, 0.5, 0.5)
51
SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=10605252"
52
SpecialMesh4.MeshType = Enum.MeshType.FileMesh
53
SpecialMesh4.Scale = Vector3.new(0.5, 0.5, 0.5)
54
Script5.Name = "HammerScript"
55
Script5.Parent = Tool0
56
table.insert(cors,sandbox(Script5,function()
57
-------- OMG HAX
58
59
r = game:service("RunService")
60
61
62
Tool = script.Parent
63
hammer = Tool.Handle
64
65
local shockRing = Instance.new("Part")
66
shockRing.formFactor = 2
67
shockRing.Size = Vector3.new(1, 0.4, 1)
68
shockRing.Anchored = true
69
shockRing.Locked = true
70
shockRing.CanCollide = false
71
shockRing.archivable = false
72
shockRing.TopSurface = 0
73
shockRing.BottomSurface = 0
74
shockRing.Transparency = 1
75
local decal = Instance.new("Decal")
76
decal.Face = 1
77
decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
78
decal.Parent = shockRing
79
80
local bottomDecal = decal:Clone()
81
bottomDecal.Face = 4
82
bottomDecal.Parent = shockRing
83
84
85
86
function doDamage(hit)
87
	local humanoid = hit.Parent:findFirstChild("Humanoid")
88
	local vCharacter = Tool.Parent
89
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
90
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
91
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
92
		tagHumanoid(humanoid, vPlayer)
93
		humanoid:TakeDamage(humanoid.MaxHealth)
94
		if humanoid.Health <= 0 then
95
			local c = hit.CFrame
96
			hit.CFrame = CFrame.new(hit.Position)
97
			hit.CFrame = c
98
		end
99
		delay(1, function() untagHumanoid(humanoid) end)
100
	else
101
		local c = hit.CFrame	hit:BreakJoints()	hit.CFrame = CFrame.new(hit.Position)	hit.CFrame = c
102
	end
103
end
104
105
106
function tagHumanoid(humanoid, player)
107
	local creator_tag = Instance.new("ObjectValue")
108
	creator_tag.Value = player
109
	creator_tag.Name = "creator"
110
	creator_tag.Parent = humanoid
111
end
112
113
function untagHumanoid(humanoid)
114
	if humanoid ~= nil then
115
		local tag = humanoid:findFirstChild("creator")
116
		if tag ~= nil then
117
			tag.Parent = nil
118
		end
119
	end
120
end
121
122
function blow(obj, pos, notme)
123
	if (obj ~= notme) then
124
		if (obj.className == "Part") or (obj.className == "Seat") then
125
			if (not obj.Anchored) and (((pos - obj.Position) * Vector3.new(1, 0, 1)).magnitude < 96) and (pos.y <= obj.Position.y + 8) and (pos.y >= obj.Position.y - 8) then
126
				delay((pos - obj.Position).magnitude / 96, function()	doDamage(obj)	obj.Velocity = ((obj.Position - pos).unit + Vector3.new(0, 0.5, 0)) * 96 + obj.Velocity	obj.RotVelocity = obj.RotVelocity + Vector3.new(obj.Position.z - pos.z, 0, pos.x - obj.Position.x).unit * 40	end)
127
			end
128
		elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
129
			local list = obj:GetChildren()
130
			for x = 1, #list do
131
				blow(list[x], pos, notme)
132
			end
133
		end
134
	end
135
end
136
137
function attack()
138
	damage = slash_damage
139
	local anim = Instance.new("StringValue")
140
	anim.Name = "toolanim"
141
	anim.Value = "Slash"
142
	anim.Parent = Tool
143
	wait(0.2)
144
145
	print("Blasting!")
146
147
	local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
148
149
	blow(workspace, pos, Tool.Parent)
150
151
	shockRing.CFrame = CFrame.new(pos)
152
	for x = 1, 29 do
153
		delay(x / 30, function()	shockRing.Parent = nil	shockRing.Size = Vector3.new(0, 0.4, 0) + Vector3.new(6.4, 0, 6.4) * x	shockRing.Parent = Tool	end)
154
	end
155
	delay(1, function() shockRing.Parent = nil end)
156
end
157
158
159
Tool.Enabled = true
160
function onActivated()
161
162
	if not Tool.Enabled then
163
		return
164
	end
165
166
	Tool.Enabled = false
167
168
	local character = Tool.Parent;
169
	local humanoid = character.Humanoid
170
	if humanoid == nil then
171
		print("Humanoid not found")
172
		return 
173
	end
174
175
	hammer.Boom:Play()
176
	attack()
177
178
	wait(0.5)
179
180
	Tool.Enabled = true
181
end
182
183
184
script.Parent.Activated:connect(onActivated)
185
--script.Parent.Equipped:connect(onEquipped)
186
end))
187
Script6.Name = "Two-Handed Script"
188
Script6.Parent = Tool0
189
table.insert(cors,sandbox(Script6,function()
190
--By Naruto902
191
--player
192
player = nil
193
--save shoulders
194
RSH, LSH = nil, nil
195
--grip
196
GRP = nil
197
--welds
198
RW, LW = Instance.new("Weld"), Instance.new("Weld")
199
--what anim
200
anim = "none"
201
202
--onselected, save shoulders and get player
203
script.Parent.Equipped:connect(function()
204
	player = game.Players:playerFromCharacter(script.Parent.Parent)
205
	local ch = script.Parent.Parent
206
	RSH = ch.Torso["Right Shoulder"]
207
	LSH = ch.Torso["Left Shoulder"]
208
	GRP = ch["Right Arm"].RightGrip
209
	--
210
	RSH.Parent = nil
211
	LSH.Parent = nil
212
	--
213
	RW.Part0 = ch.Torso
214
	RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
215
	RW.C1 = CFrame.new(0, 0.5, 0)
216
	RW.Part1 = ch["Right Arm"]
217
	RW.Parent = ch.Torso
218
	_G.R = RW
219
	--
220
	LW.Part0 = ch.Torso
221
	LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
222
	LW.C1 = CFrame.new(0, 0.5, 0)
223
	LW.Part1 = ch["Left Arm"]
224
	LW.Parent = ch.Torso
225
	_G.L = LW
226
	--
227
	GRP.C0 = CFrame.new(0, -1, 0) * CFrame.fromEulerAnglesXYZ(-1, 0, 0)
228
	--Bring_Arm_Up animation
229
	for i = 0, 1, 0.05 do
230
		wait()
231
		RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.3*i, 0, -0.5*i)
232
		LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7*i, 0, 0.8*i)	
233
		LW.C1 = CFrame.new(-0.3*i, 0.5+1.2*i, 0)
234
	end
235
end)
236
237
--griptcf = CFrame.new(0, -1, 0) * CFrame.fromEulerAnglesXYZ(-math.pi/2+0.5, 0, 0)
238
239
script.Parent.Unequipped:connect(function()
240
	--Bring_Arm_Down animation
241
	for i = 1, 0, -0.05 do
242
		wait()
243
		RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.3*i, 0, -0.5*i)
244
		LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7*i, 0, 0.8*i)	
245
		LW.C1 = CFrame.new(-0.3*i, 0.5+1.2*i, 0)
246
	end
247
	RW.Parent = nil
248
	LW.Parent = nil
249
	RSH.Parent = player.Character.Torso
250
	LSH.Parent = player.Character.Torso
251
end)
252
253
function HomeRunHit(part)
254
	local h = (part.Parent or game):FindFirstChild("Humanoid") --or findfirstchild optimization
255
	if h then
256
		h.Sit = true
257
		wait()
258
		h.Jump = true
259
		h.Parent.Torso.Velocity = (CFrame.new(script.Parent.Handle.Position, h.Parent.Torso.Position).lookVector * 100) + Vector3.new(0, 30, 0)
260
		h.Parent.Torso.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
261
	end
262
end
263
end))
264
for i,v in pairs(mas:GetChildren()) do
265
	v.Parent = {"8NOU"}.Backpack
266-
	v.Parent = owner.Backpack
266+
267
end
268
mas:Destroy()
269
for i,v in pairs(cors) do
270
	spawn(function()
271
		pcall(v)
272
	end)
273
end