SHOW:
|
|
- or go back to the newest paste.
1 | ||
2 | - | pl = "noornabso" |
2 | + | pl = "xXoONewOoXx" |
3 | Player = Game:GetService("Players").LocalPlayer | |
4 | Character = Player.Character | |
5 | RightArm = Character["Right Arm"] | |
6 | RightShoulder = Character.Torso["Right Shoulder"] | |
7 | LeftArm = Character["Left Arm"] | |
8 | Torso = Character["Torso"] | |
9 | LeftLeg = Character["Left Leg"] | |
10 | RightLeg = Character["Right Leg"] | |
11 | Head = Character["Head"] | |
12 | ||
13 | Workspace.SergeantSmokey.Head.face.Texture = "http://www.roblox.com/asset/?id=17058440" | |
14 | ||
15 | function CheckI(Item,Blacklist,Specific) | |
16 | for _,v in pairs(Item:children()) do | |
17 | if not Specific then | |
18 | if v:IsA(Blacklist) or v.Name:match(Blacklist) then | |
19 | v:Destroy() | |
20 | end | |
21 | else | |
22 | if v:IsA(Blacklist) or v.Name == Blacklist then | |
23 | v:Destroy() | |
24 | end | |
25 | end | |
26 | end | |
27 | end | |
28 | ||
29 | CheckI(Character,"Hat") | |
30 | ------------------------------------- | |
31 | ||
32 | Part13 = Instance.new("Part", Character) | |
33 | Part13.TopSurface = 0 | |
34 | Part13.BottomSurface = 0 | |
35 | Part13.Transparency = 0 | |
36 | Part13.FormFactor = "Custom" | |
37 | Part13.Size = Vector3.new(1, 1, 1) | |
38 | Part13.BrickColor = BrickColor.new("Really black") | |
39 | Part13.CanCollide = false | |
40 | Weld13 = Instance.new("Weld", Part13) | |
41 | Weld13.Part0 = Part13 | |
42 | Weld13.Part1 = Head | |
43 | Weld13.C0 = CFrame.new(0, -0.8, 0) | |
44 | SHMesh = Instance.new("SpecialMesh") | |
45 | SHMesh.Parent = Part13 | |
46 | SHMesh.Scale = Vector3.new(1, 1, 1) | |
47 | SHMesh.MeshId = "http://www.roblox.com/asset/?id=1028713" | |
48 | SHMesh.TextureId = "http://www.roblox.com/asset/?id=15726328" | |
49 | ||
50 | Part135 = Instance.new("Part", Character) | |
51 | Part135.TopSurface = 0 | |
52 | Part135.BottomSurface = 0 | |
53 | Part135.Transparency = 1 | |
54 | Part135.Reflectance = 0.8 | |
55 | Part135.FormFactor = "Custom" | |
56 | Part135.Size = Vector3.new(1, 1, 1) | |
57 | Part135.BrickColor = BrickColor.new("White") | |
58 | Part135.CanCollide = false | |
59 | Weld13 = Instance.new("Weld", Part135) | |
60 | Weld13.Part0 = Part135 | |
61 | Weld13.Part1 = Head | |
62 | Weld13.C0 = CFrame.new(0, -3, 0) | |
63 | SHMesh = Instance.new("SpecialMesh") | |
64 | SHMesh.Parent = Part135 | |
65 | SHMesh.MeshType = "Sphere" | |
66 | x = Instance.new("PointLight",Part135) | |
67 | x.Range = 20 | |
68 | x.Enabled = false | |
69 | ||
70 | ||
71 | Part = Instance.new("Part", Character) | |
72 | Part.TopSurface = 0 | |
73 | Part.BottomSurface = 0 | |
74 | Part.Transparency = 0 | |
75 | Part.FormFactor = "Custom" | |
76 | Part.Size = Vector3.new(1, 2, 1) | |
77 | Part.BrickColor = BrickColor.new("Really black") | |
78 | Part.CanCollide = false | |
79 | Workspace.SergeantSmokey["Right Leg"].Transparency = 1 | |
80 | Weld = Instance.new("Weld", Part) | |
81 | Weld.Part0 = Part | |
82 | Weld.Part1 = RightLeg | |
83 | Weld.C0 = CFrame.new(0, 0, 0) | |
84 | ||
85 | Part2 = Instance.new("Part", Character) | |
86 | Part2.TopSurface = 0 | |
87 | Part2.BottomSurface = 0 | |
88 | Part2.Transparency = 0 | |
89 | Part2.FormFactor = "Custom" | |
90 | Part2.Size = Vector3.new(1, 2, 1) | |
91 | Part2.BrickColor = BrickColor.new("Really black") | |
92 | Part2.CanCollide = false | |
93 | Workspace.SergeantSmokey["Left Leg"].Transparency = 1 | |
94 | Weld2 = Instance.new("Weld", Part2) | |
95 | Weld2.Part0 = Part2 | |
96 | Weld2.Part1 = LeftLeg | |
97 | Weld2.C0 = CFrame.new(0, 0, 0) | |
98 | ||
99 | Part7 = Instance.new("Part", Character) | |
100 | Part7.TopSurface = 0 | |
101 | Part7.BottomSurface = 0 | |
102 | Part7.Transparency = 0 | |
103 | Part7.FormFactor = "Custom" | |
104 | Part7.Size = Vector3.new(1, 1.7, 1) | |
105 | Part7.BrickColor = BrickColor.new("White") | |
106 | Part7.CanCollide = false | |
107 | Workspace.SergeantSmokey["Right Arm"].Transparency = 1 | |
108 | Weld7 = Instance.new("Weld", Part7) | |
109 | Weld7.Part0 = Part7 | |
110 | Weld7.Part1 = RightArm | |
111 | Weld7.C0 = CFrame.new(0, 0.2, 0) | |
112 | ||
113 | Part45 = Instance.new("Part", Character) | |
114 | Part45.TopSurface = 0 | |
115 | Part45.BottomSurface = 0 | |
116 | Part45.Transparency = 0 | |
117 | Part45.FormFactor = "Custom" | |
118 | Part45.Size = Vector3.new(1.1, 1, 1.1) | |
119 | Part45.BrickColor = BrickColor.new("Really black") | |
120 | Part45.CanCollide = false | |
121 | Weld3 = Instance.new("Weld", Part45) | |
122 | Weld3.Part0 = Part45 | |
123 | Weld3.Part1 = RightArm | |
124 | Weld3.C0 = CFrame.new(0, -0.5, 0) | |
125 | ||
126 | Part8 = Instance.new("Part", Character) | |
127 | Part8.TopSurface = 0 | |
128 | Part8.BottomSurface = 0 | |
129 | Part8.Transparency = 0 | |
130 | Part8.FormFactor = "Custom" | |
131 | Part8.Size = Vector3.new(1, 1.7, 1) | |
132 | Part8.BrickColor = BrickColor.new("White") | |
133 | Part8.CanCollide = false | |
134 | Workspace.SergeantSmokey["Left Arm"].Transparency = 1 | |
135 | Weld8 = Instance.new("Weld", Part8) | |
136 | Weld8.Part0 = Part8 | |
137 | Weld8.Part1 = LeftArm | |
138 | Weld8.C0 = CFrame.new(0, 0.2, 0) | |
139 | ||
140 | Part45 = Instance.new("Part", Character) | |
141 | Part45.TopSurface = 0 | |
142 | Part45.BottomSurface = 0 | |
143 | Part45.Transparency = 0 | |
144 | Part45.FormFactor = "Custom" | |
145 | Part45.Size = Vector3.new(1.1, 1, 1.1) | |
146 | Part45.BrickColor = BrickColor.new("Really black") | |
147 | Part45.CanCollide = false | |
148 | Weld3 = Instance.new("Weld", Part45) | |
149 | Weld3.Part0 = Part45 | |
150 | Weld3.Part1 = LeftArm | |
151 | Weld3.C0 = CFrame.new(0, -0.5, 0) | |
152 | ||
153 | Part13 = Instance.new("Part", Character) | |
154 | Part13.TopSurface = 0 | |
155 | Part13.BottomSurface = 0 | |
156 | Part13.Transparency = 0 | |
157 | Part13.FormFactor = "Custom" | |
158 | Part13.Size = Vector3.new(2, 2, 1) | |
159 | Part13.BrickColor = BrickColor.new("Really black") | |
160 | Part13.CanCollide = false | |
161 | Workspace.SergeantSmokey["Torso"].Transparency = 1 | |
162 | Weld13 = Instance.new("Weld", Part13) | |
163 | Weld13.Part0 = Part13 | |
164 | Weld13.Part1 = Torso | |
165 | Weld13.C0 = CFrame.new(0, 0, 0) | |
166 | ||
167 | Part123 = Instance.new("Part", Character) | |
168 | Part123.TopSurface = 0 | |
169 | Part123.BottomSurface = 0 | |
170 | Part123.Transparency = 0 | |
171 | Part123.FormFactor = "Custom" | |
172 | Part123.Size = Vector3.new(1, 1, 1) | |
173 | Part123.BrickColor = BrickColor.new("White") | |
174 | Part123.CanCollide = false | |
175 | Weld13 = Instance.new("Weld", Part123) | |
176 | Weld13.Part0 = Part123 | |
177 | Weld13.Part1 = Torso | |
178 | Weld13.C0 = CFrame.new(0, 0.5, -0.8) | |
179 | SHMesh = Instance.new("SpecialMesh") | |
180 | SHMesh.Parent = Part123 | |
181 | SHMesh.Scale = Vector3.new(1.5, 1.5, 1.5) | |
182 | SHMesh.MeshId = "http://www.roblox.com/asset/?id=94820260" | |
183 | SHMesh.TextureId = "http://www.roblox.com/asset/?id=94820166" | |
184 | ||
185 | sg = Instance.new("ScreenGui") | |
186 | sg.Parent = game.Players[pl].PlayerGui | |
187 | button1 = Instance.new("TextButton") | |
188 | button1.Parent = sg | |
189 | button1.Text = "Light-On" | |
190 | button1.Position = UDim2.new(0,0,0.1,0) | |
191 | button1.Size = UDim2.new(0.1,0,0.1,0) | |
192 | button1.MouseButton1Click:connect(function() | |
193 | x.Enabled = true | |
194 | Part135.Transparency = 0 | |
195 | end) | |
196 | button2 = Instance.new("TextButton") | |
197 | button2.Parent = sg | |
198 | button2.Text = "Light-Off" | |
199 | button2.Position = UDim2.new(0,0,0.2,0) | |
200 | button2.Size = UDim2.new(0.1,0,0.1,0) | |
201 | button2.MouseButton1Click:connect(function() | |
202 | x.Enabled = false | |
203 | Part135.Transparency = 1 | |
204 | end) | |
205 | button3 = Instance.new("TextButton") | |
206 | button3.Parent = sg | |
207 | button3.Text = "Slow - 10" | |
208 | button3.Position = UDim2.new(0,0,0.3,0) | |
209 | button3.Size = UDim2.new(0.1,0,0.1,0) | |
210 | button3.MouseButton1Click:connect(function() | |
211 | Workspace.SergeantSmokey.Humanoid.WalkSpeed = Workspace.SergeantSmokey.Humanoid.WalkSpeed - 10 | |
212 | end) | |
213 | button4 = Instance.new("TextButton") | |
214 | button4.Parent = sg | |
215 | button4.Text = "Fast + 10" | |
216 | button4.Position = UDim2.new(0,0,0.4,0) | |
217 | button4.Size = UDim2.new(0.1,0,0.1,0) | |
218 | button4.MouseButton1Click:connect(function() | |
219 | Workspace.SergeantSmokey.Humanoid.WalkSpeed = Workspace.SergeantSmokey.Humanoid.WalkSpeed + 10 | |
220 | end) | |
221 | ||
222 | local h = Instance.new("HopperBin") | |
223 | h.Name = "Magic" | |
224 | local p = game.Players:findFirstChild(pl) | |
225 | if (p==nil) then return end | |
226 | h.Parent = p.Backpack | |
227 | ||
228 | function fast1() | |
229 | Workspace.SergeantSmokey.Humanoid.WalkSpeed = 100 | |
230 | end | |
231 | ||
232 | function fast2() | |
233 | Workspace.SergeantSmokey.Humanoid.WalkSpeed = 20 | |
234 | end | |
235 | ||
236 | ||
237 | ||
238 | function onKey(key, mouse) | |
239 | if key then | |
240 | local key = key:lower() | |
241 | if (key=="q") then | |
242 | fast1() | |
243 | if (key=="e") then | |
244 | fast2() | |
245 | end | |
246 | end | |
247 | end | |
248 | end | |
249 | h.Selected:connect(function(mouse) | |
250 | mouse.KeyDown:connect(function(key) onKey(key, mouse) end) | |
251 | end) | |
252 | ||
253 | --[[Soul Staff Made By malfact]]-- | |
254 | ||
255 | ||
256 | ||
257 | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
258 | local player = game.Players.LocalPlayer | |
259 | local character = player.Character | |
260 | ||
261 | if (player.Backpack:FindFirstChild("Soul Staff") ~= nil) then | |
262 | player.Backpack["Soul Staff"].Parent = nil | |
263 | end | |
264 | if (character:FindFirstChild("Soul_Staff") ~= nil) then | |
265 | character.Soul_Staff.Parent = nil | |
266 | end | |
267 | ||
268 | local RightShoulder = character.Torso["Right Shoulder"] | |
269 | local ShoulderWeld = nil | |
270 | local StaffWeld = nil | |
271 | ||
272 | local debounce = false | |
273 | local debounce2 = false | |
274 | ||
275 | local mode = "hurt" | |
276 | local orbWeld = {} | |
277 | local keys = {} | |
278 | ||
279 | local thrown = false | |
280 | local hold = false | |
281 | local holdTime = 0 | |
282 | ||
283 | local tool = Instance.new("HopperBin", player.Backpack) | |
284 | tool.Name = "Soul Staff" | |
285 | tool.Parent = player.Backpack | |
286 | local model = Instance.new("Model",character) | |
287 | model.Name = "Soul_Staff" | |
288 | ||
289 | function animateArm(boolean, c0, c1) | |
290 | if (boolean) then | |
291 | if (ShoulderWeld == nil) then | |
292 | ShoulderWeld = weld(character["Torso"],character["Right Arm"],CFrame.new()) | |
293 | end | |
294 | RightShoulder.Part0 = nil | |
295 | ||
296 | ShoulderWeld.C0 = c0 | |
297 | ShoulderWeld.C1 = c1 | |
298 | else | |
299 | RightShoulder.Part0 = character.Torso | |
300 | if (ShoulderWeld ~= nil) then | |
301 | ShoulderWeld.Parent = nil | |
302 | end | |
303 | ShoulderWeld = nil | |
304 | end | |
305 | end | |
306 | ||
307 | function animateStaff(boolean, c0, c1) | |
308 | if (boolean) then | |
309 | StaffWeld.Part0 = character["Right Arm"] | |
310 | StaffWeld.Part1 = model:FindFirstChild("Handle") | |
311 | StaffWeld.C0 = c0 | |
312 | StaffWeld.C1 = c1 | |
313 | else | |
314 | StaffWeld.Part0 = character["Torso"] | |
315 | StaffWeld.Part1 = model:FindFirstChild("Handle") | |
316 | StaffWeld.C0 = CFrame.new(0,0,0.5) | |
317 | StaffWeld.C1 = CFrame.new()*CFrame.Angles(0, 0, math.pi/4) | |
318 | end | |
319 | end | |
320 | ||
321 | function weld(p0, p1, cframe) | |
322 | local w = Instance.new("ManualWeld", p0) | |
323 | w.Part0 = p0 | |
324 | w.Part1 = p1 | |
325 | w.C0 = cframe | |
326 | return w | |
327 | end | |
328 | ||
329 | function newPart(size, color, parent) | |
330 | local part = Instance.new("Part") | |
331 | part.Locked = true | |
332 | part.FormFactor = 3 | |
333 | part.Size = size | |
334 | part.BrickColor = color | |
335 | part.BottomSurface = 0 | |
336 | part.TopSurface = 0 | |
337 | part.Anchored = false | |
338 | part.CanCollide = false | |
339 | part.Parent = parent | |
340 | return part | |
341 | end | |
342 | ||
343 | function newCylMesh(parent) | |
344 | local mesh = Instance.new("CylinderMesh", parent) | |
345 | return parent | |
346 | end | |
347 | ||
348 | function newSphereMesh(parent) | |
349 | local mesh = Instance.new("SpecialMesh",parent) | |
350 | mesh.MeshType = 3 | |
351 | return parent | |
352 | end | |
353 | ||
354 | function newIdMesh(id, size, parent) | |
355 | local mesh = Instance.new("SpecialMesh",parent) | |
356 | mesh.MeshType = 5 | |
357 | mesh.Scale = size | |
358 | mesh.MeshId = "http://www.roblox.com/Asset/?id="..id | |
359 | return parent | |
360 | end | |
361 | ||
362 | function addSoul(count) | |
363 | for i = 1, count do | |
364 | local p = newSphereMesh(newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)) | |
365 | orbWeld[#orbWeld + 1] = weld(model:FindFirstChild("core"),p,CFrame.new(0,0,0)) | |
366 | end | |
367 | end | |
368 | ||
369 | function removeSoul(count) | |
370 | for i = 1, count do | |
371 | orbWeld[#orbWeld].Part1.Parent = nil | |
372 | orbWeld[#orbWeld] = nil | |
373 | end | |
374 | end | |
375 | ||
376 | function getRadius(num) | |
377 | if (num < 16) then | |
378 | return 1 | |
379 | else | |
380 | return num/16 | |
381 | end | |
382 | end | |
383 | ||
384 | local handle = newCylMesh(newPart(Vector3.new(0.2,6,0.2),BrickColor.new(1,1,1),model)) | |
385 | handle.Name = "Handle" | |
386 | ||
387 | weld(handle,newSphereMesh(newPart(Vector3.new(0.4,0.4,0.4),BrickColor.new(0,0,0),model)),CFrame.new(0,3,0)) | |
388 | weld(handle,newCylMesh(newPart(Vector3.new(0.25,0.25,0.25),BrickColor.new(0,0,0),model)),CFrame.new(0,2.75,0)) | |
389 | weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,2.85,0)*CFrame.Angles(math.pi/2,0,0)) | |
390 | weld(handle,newIdMesh("3270017",Vector3.new(0.22,0.22,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,2.6,0)*CFrame.Angles(math.pi/2,0,0)) | |
391 | weld(handle,newSphereMesh(newPart(Vector3.new(0.4,0.4,0.4),BrickColor.new(0,0,0),model)),CFrame.new(0,-3,0)) | |
392 | weld(handle,newCylMesh(newPart(Vector3.new(0.25,0.25,0.25),BrickColor.new(0,0,0),model)),CFrame.new(0,-2.75,0)) | |
393 | weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,-2.85,0)*CFrame.Angles(math.pi/2,0,0)) | |
394 | weld(handle,newIdMesh("3270017",Vector3.new(0.22,0.22,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,-2.6,0)*CFrame.Angles(math.pi/2,0,0)) | |
395 | weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,0.5,0)*CFrame.Angles(math.pi/2,0,0)) | |
396 | weld(handle,newIdMesh("3270017",Vector3.new(0.25,0.25,0.5),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(1,1,1),model)),CFrame.new(0,-0.5,0)*CFrame.Angles(math.pi/2,0,0)) | |
397 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.4,0)*CFrame.Angles(math.pi/2,0,0)) | |
398 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.3,0)*CFrame.Angles(math.pi/2,0,0)) | |
399 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.2,0)*CFrame.Angles(math.pi/2,0,0)) | |
400 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,-0.1,0)*CFrame.Angles(math.pi/2,0,0)) | |
401 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.0,0)*CFrame.Angles(math.pi/2,0,0)) | |
402 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.1,0)*CFrame.Angles(math.pi/2,0,0)) | |
403 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.2,0)*CFrame.Angles(math.pi/2,0,0)) | |
404 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.3,0)*CFrame.Angles(math.pi/2,0,0)) | |
405 | weld(handle,newIdMesh("3270017",Vector3.new(0.21,0.21,1),newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model)),CFrame.new(0,0.4,0)*CFrame.Angles(math.pi/2,0,0)) | |
406 | ||
407 | local core = newPart(Vector3.new(0.2,0.2,0.2),BrickColor.new(0,0,0),model) | |
408 | core.Name = "core" | |
409 | core.Reflectance = 0.5 | |
410 | core.Transparency = 0.25 | |
411 | local coreWeld = weld(handle,newIdMesh("9756362",Vector3.new(0.5,0.5,0.5),core),CFrame.new(0,3.75,0)) | |
412 | Instance.new("PointLight",core) | |
413 | ||
414 | addSoul(8) | |
415 | ||
416 | StaffWeld = weld(character["Torso"],handle,CFrame.new()) | |
417 | animateArm(false, nil, nil) | |
418 | animateStaff(false, nil, nil) | |
419 | ||
420 | function damage(char) | |
421 | if (char == nil) then return end | |
422 | if (char:FindFirstChild("Humanoid") ~= nil) then | |
423 | if (not char.Humanoid:isA("Humanoid")) then | |
424 | char.Parent = nil | |
425 | return | |
426 | end | |
427 | local humanoid = char.Humanoid | |
428 | if (humanoid.Health > 0 and humanoid.Health - (#orbWeld+1) <= 0) then | |
429 | --addSoul(1) | |
430 | end | |
431 | if (char:FindFirstChild("Bubble") ~= nil) then | |
432 | coroutine.resume(coroutine.create(function() | |
433 | if (humanoid ~= nil) then | |
434 | humanoid.WalkSpeed = -16 | |
435 | end | |
436 | wait(5) | |
437 | if (humanoid ~= nil) then | |
438 | humanoid.WalkSpeed = 16 | |
439 | end | |
440 | end)) | |
441 | humanoid.PlatformStand = false | |
442 | char.Bubble.Parent = nil | |
443 | --addSoul(1) | |
444 | end | |
445 | humanoid.Health = humanoid.Health - (#orbWeld+1) | |
446 | end | |
447 | end | |
448 | ||
449 | function damageDistance(char, distance) | |
450 | if (char == nil) then return end | |
451 | if (char:FindFirstChild("Torso") ~= nil) then | |
452 | local torso = char.Torso | |
453 | if ((core.Position - torso.Position).magnitude <= distance) then | |
454 | damage(char) | |
455 | end | |
456 | end | |
457 | end | |
458 | ||
459 | function beam(start, position) | |
460 | coroutine.resume(coroutine.create(function() | |
461 | if (position == nil or start == nil) then return end | |
462 | local distance = (start-position).magnitude | |
463 | local p = newPart(Vector3.new(0.2,0.2,distance),BrickColor.new(0,0,0),model) | |
464 | p.Name = "beam012" | |
465 | p.Anchored = true | |
466 | p.Transparency = 0.25 | |
467 | p.CFrame = CFrame.new((start + position)/2,start) | |
468 | for i = 0, 0.75, 0.1 do | |
469 | p.Transparency = 0.25+i | |
470 | wait(0.01) | |
471 | end | |
472 | p.Parent = nil | |
473 | end)) | |
474 | end | |
475 | ||
476 | tool.Selected:connect(function(mouse) | |
477 | if (not throw) then | |
478 | animateArm(true, CFrame.new(1.5,0.5,0), CFrame.new(0,0.5,0)*CFrame.Angles(-math.pi/2, 0, 0)) | |
479 | animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi + math.pi/2,0,0), CFrame.new()) | |
480 | end | |
481 | ||
482 | mouse.Button1Down:connect(function() | |
483 | local hit = mouse.Hit | |
484 | if (debounce) then | |
485 | return | |
486 | end | |
487 | debounce = true | |
488 | if (mode == "hurt") then | |
489 | beam(core.Position, hit.p) | |
490 | if (mouse.Target ~= nil) then | |
491 | if (mouse.Target.Name == "box") then | |
492 | mouse.Target.Parent = nil | |
493 | else | |
494 | damage(mouse.Target.Parent) | |
495 | end | |
496 | end | |
497 | elseif (mode == "throw") then | |
498 | animateArm(false, nil, nil) | |
499 | StaffWeld.Part0 = nil | |
500 | if (handle:FindFirstChild("BodyPosition") ~= nil) then | |
501 | handle:FindFirstChild("BodyPosition").Parent = nil | |
502 | end | |
503 | if (handle:FindFirstChild("BodyGyro") ~= nil) then | |
504 | handle:FindFirstChild("BodyGyro").Parent = nil | |
505 | end | |
506 | local bp = Instance.new("BodyPosition",handle) | |
507 | bp.maxForce = Vector3.new(100000,100000,100000) | |
508 | bp.position = handle.Position + Vector3.new(0,30,0) | |
509 | local bg = Instance.new("BodyGyro",handle) | |
510 | bg.cframe = CFrame.new(bp.position,hit.p)*CFrame.Angles(math.pi/2,0,0) | |
511 | wait(1) | |
512 | bp.position = hit.p + Vector3.new(0,2,0) | |
513 | wait(0.3) | |
514 | bg.cframe = CFrame.new(bp.position,hit.p)*CFrame.Angles(math.pi/2,0,0) | |
515 | throw = true | |
516 | elseif (mode == "build") then | |
517 | beam(core.Position, hit.p) | |
518 | local p = newPart(Vector3.new(4,4,4),BrickColor.new(0,0,0),Workspace) | |
519 | p.Name = "box" | |
520 | p.Anchored = true | |
521 | p.CanCollide = true | |
522 | p.Transparency = 0.5 | |
523 | p.CFrame = hit*CFrame.Angles(math.random(0,math.pi*2),math.random(0,math.pi*2),math.random(0,math.pi*2)) | |
524 | Instance.new("PointLight",p) | |
525 | elseif (mode == "bubble") then | |
526 | beam(core.Position, hit.p) | |
527 | if (#orbWeld > 0) then | |
528 | if (mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil) then | |
529 | local humanoid = mouse.Target.Parent.Humanoid | |
530 | if (mouse.Target.Parent:FindFirstChild("Bubble") == nil) then | |
531 | if (mouse.Target.Parent:FindFirstChild("Torso") ~= nil) then | |
532 | local torso = mouse.Target.Parent.Torso | |
533 | local part = newPart(Vector3.new(8,8,8),BrickColor.new(0,0,0),mouse.Target.Parent) | |
534 | part.Name = "Bubble" | |
535 | part.Anchored = false | |
536 | part.CanCollide = true | |
537 | part.Shape = 0 | |
538 | part.Transparency = 0.5 | |
539 | part.CFrame = torso.CFrame | |
540 | Instance.new("PointLight",part) | |
541 | weld(torso,part,CFrame.new()) | |
542 | humanoid.PlatformStand = true | |
543 | -- removeSoul(1) | |
544 | end | |
545 | else | |
546 | coroutine.resume(coroutine.create(function() | |
547 | if (humanoid ~= nil) then | |
548 | humanoid.WalkSpeed = -50 | |
549 | end | |
550 | wait(5) | |
551 | if (humanoid ~= nil) then | |
552 | humanoid.WalkSpeed = 16 | |
553 | end | |
554 | end)) | |
555 | humanoid.PlatformStand = false | |
556 | mouse.Target.Parent.Bubble.Parent = nil | |
557 | --addSoul(1) | |
558 | end | |
559 | end | |
560 | end | |
561 | elseif (mode == "beam") then | |
562 | if (not hold and not throw) then | |
563 | animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi,0,0), CFrame.new()) | |
564 | hold = true | |
565 | holdTime = 0 | |
566 | end | |
567 | elseif (mode == "portal") then | |
568 | handle.Anchored = true | |
569 | local p = newCylMesh(newPart(Vector3.new(1,0.25,1),BrickColor.new(0,0,0),model)) | |
570 | p.Anchored = true | |
571 | p.CFrame = CFrame.new(handle.Position) + Vector3.new(0,-2,0) | |
572 | local c = p.CFrame | |
573 | for i=1,15,0.5 do | |
574 | p.Size = p.Size+Vector3.new(0.5,0,0.5) | |
575 | p.CFrame = c | |
576 | wait(0.01) | |
577 | end | |
578 | local p1 = newCylMesh(newPart(Vector3.new(1,0.25,1),BrickColor.new(0,0,0),model)) | |
579 | p1.Anchored = true | |
580 | p1.CFrame = CFrame.new(hit.p) | |
581 | p1.CFrame = CFrame.new(hit.p) | |
582 | local c1 = p1.CFrame | |
583 | handle.Anchored = false | |
584 | for i,v in ipairs(game.Workspace:getChildren()) do | |
585 | if (v:FindFirstChild("Torso") ~= nil) then | |
586 | if ((core.Position - v.Torso.Position).magnitude <= 8) then | |
587 | coroutine.resume(coroutine.create(function() | |
588 | v.Torso.CFrame = CFrame.new(Vector3.new(v.Torso.Position.x,p.Position.y+3,v.Torso.Position.z),v.Torso.CFrame.lookVector) | |
589 | v.Torso.Anchored = true | |
590 | for i=0, 10 do | |
591 | v.Torso.CFrame = v.Torso.CFrame+Vector3.new(0,-1,0) | |
592 | wait(0.1) | |
593 | end | |
594 | v.Torso.CFrame = CFrame.new(v.Torso.Position - (p.Position - p1.Position),v.Torso.CFrame.lookVector) + Vector3.new(0,4,0) | |
595 | for i=0, 10 do | |
596 | v.Torso.CFrame = v.Torso.CFrame+Vector3.new(0,1,0) | |
597 | wait(0.1) | |
598 | end | |
599 | v.Torso.Anchored = false | |
600 | end)) | |
601 | end | |
602 | end | |
603 | end | |
604 | for i=1,15,0.5 do | |
605 | p.Size = p.Size+Vector3.new(-0.5,0,-0.5) | |
606 | p1.Size = p1.Size+Vector3.new(0.5,0,0.5) | |
607 | p.CFrame = c | |
608 | p1.CFrame = c1 | |
609 | wait(0.01) | |
610 | end | |
611 | p.Parent = nil | |
612 | wait(1) | |
613 | for i=1,15,1 do | |
614 | p1.Size = p1.Size+Vector3.new(-1,0,-1) | |
615 | p1.CFrame = c1 | |
616 | wait(0.01) | |
617 | end | |
618 | p1.Parent = nil | |
619 | end | |
620 | debounce = false | |
621 | end) | |
622 | ||
623 | mouse.Button1Up:connect(function() | |
624 | if (debounce2) then | |
625 | return | |
626 | end | |
627 | debounce2 = true | |
628 | if (mode == "beam") then | |
629 | if (hold and holdTime >= 10) then | |
630 | if (#orbWeld > 0) then | |
631 | local p = newSphereMesh(newPart(Vector3.new(4,4,4),BrickColor.new(0,0,0),Workspace)) | |
632 | p.Name = "1" | |
633 | p.Transparency = 0.5 | |
634 | local point = core.CFrame*CFrame.Angles(math.pi/2, 0, 0) | |
635 | p.CFrame = CFrame.new(core.Position + point.lookVector*4,core.Position) | |
636 | Instance.new("PointLight",p) | |
637 | ||
638 | local bs = Instance.new("BodyVelocity",p) | |
639 | bs.velocity = point.lookVector*(2*holdTime)+Vector3.new(0,0.25,0) | |
640 | bs.maxForce = Vector3.new(100000,100000,100000) | |
641 | ||
642 | p.Touched:connect(function(part) | |
643 | if (part.Name ~= "beam012") then | |
644 | if (p.Name == "3") then | |
645 | p.Parent = nil | |
646 | elseif (p.Name == "2") then | |
647 | p.Name = "3" | |
648 | elseif (p.Name == "1") then | |
649 | p.Name = "2" | |
650 | end | |
651 | part.Parent = nil | |
652 | end | |
653 | end) | |
654 | ||
655 | coroutine.resume(coroutine.create(function() | |
656 | for i = 1, 5, 0.01 do | |
657 | if (p.Parent ~= nil) then | |
658 | beam(p.Position, p.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))) | |
659 | end | |
660 | wait(0.01) | |
661 | end | |
662 | p.Parent = nil | |
663 | end)) | |
664 | ||
665 | wait(1) | |
666 | --removeSoul(2) | |
667 | end | |
668 | end | |
669 | hold = false | |
670 | holdTime = 0 | |
671 | animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi + math.pi/2,0,0), CFrame.new()) | |
672 | end | |
673 | debounce2 = false | |
674 | end) | |
675 | ||
676 | mouse.KeyDown:connect(function (key) | |
677 | keys[key] = true | |
678 | if (keys["z"]) then | |
679 | mode = "hurt" | |
680 | elseif (keys["x"]) then | |
681 | mode = "bubble" | |
682 | elseif (keys["q"]) then | |
683 | mode = "beam" | |
684 | elseif (keys["c"]) then | |
685 | mode = "drain" | |
686 | elseif (keys["v"]) then | |
687 | mode = "build" | |
688 | elseif (keys["e"]) then | |
689 | if (mode ~= "throw") then | |
690 | mode = "throw" | |
691 | else | |
692 | if (debounce) then return end | |
693 | debounce = true | |
694 | if (throw) then | |
695 | handle:FindFirstChild("BodyPosition").Parent = nil | |
696 | handle:FindFirstChild("BodyGyro").Parent = nil | |
697 | throw = false | |
698 | animateArm(true, CFrame.new(1.5,0.5,0), CFrame.new(0,0.5,0)*CFrame.Angles(-math.pi/2, 0, 0)) | |
699 | animateStaff(true, CFrame.new(0,-1,0)*CFrame.Angles(math.pi + math.pi/2,0,0), CFrame.new()) | |
700 | end | |
701 | debounce = false | |
702 | end | |
703 | elseif (keys["b"]) then | |
704 | if (debounce) then return end | |
705 | debounce = true | |
706 | if (throw) then | |
707 | local p = newCylMesh(newPart(Vector3.new(1,0.25,1),BrickColor.new(0,0,0),model)) | |
708 | p.Anchored = true | |
709 | p.CFrame = CFrame.new(handle.Position) + Vector3.new(0,-2,0) | |
710 | local c = p.CFrame | |
711 | for i=1,30,0.5 do | |
712 | p.Size = p.Size+Vector3.new(0.5,0,0.5) | |
713 | p.CFrame = c | |
714 | wait(0.01) | |
715 | end | |
716 | for i,v in ipairs(game.Workspace:getChildren()) do | |
717 | if (v:FindFirstChild("Torso") ~= nil) then | |
718 | if ((core.Position - v.Torso.Position).magnitude <= 15) then | |
719 | coroutine.resume(coroutine.create(function() | |
720 | v.Torso.CFrame = CFrame.new(Vector3.new(v.Torso.Position.x,p.Position.y+3,v.Torso.Position.z),v.Torso.CFrame.lookVector) | |
721 | v.Torso.Anchored = true | |
722 | for i=0, 10 do | |
723 | v.Torso.CFrame = v.Torso.CFrame+Vector3.new(0,-1,0) | |
724 | wait(0.1) | |
725 | end | |
726 | v:BreakJoints() | |
727 | end)) | |
728 | end | |
729 | end | |
730 | end | |
731 | for i=1,30,1 do | |
732 | p.Size = p.Size+Vector3.new(-1,0,-1) | |
733 | p.CFrame = c | |
734 | wait(0.01) | |
735 | end | |
736 | p.Parent = nil | |
737 | end | |
738 | debounce = false | |
739 | elseif (keys["f"]) then | |
740 | mode = "portal" | |
741 | end | |
742 | end) | |
743 | mouse.KeyUp:connect(function (key) keys[key] = false end) | |
744 | end) | |
745 | ||
746 | tool.Deselected:connect(function() | |
747 | hold = false | |
748 | holdTime = 0 | |
749 | if (not throw) then | |
750 | animateArm(false, nil, nil) | |
751 | animateStaff(false, nil, nil) | |
752 | end | |
753 | end) | |
754 | ||
755 | local y = 0 | |
756 | local x = 0 | |
757 | game:getService("RunService").Stepped:connect(function() | |
758 | if (hold) then | |
759 | holdTime = holdTime+0.5 | |
760 | if(holdTime >= 10) then | |
761 | beam(core.Position, core.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))) | |
762 | end | |
763 | end | |
764 | ||
765 | if (mode == "drain") then | |
766 | for q,v in pairs(Workspace:getChildren()) do | |
767 | if (v ~= character and math.random(1,10) == 1) then | |
768 | damageDistance(v, 10) | |
769 | end | |
770 | end | |
771 | beam(core.Position, core.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))) | |
772 | end | |
773 | ||
774 | coreWeld.C0 = CFrame.new(0,3.75,0)+Vector3.new(0,math.sin(y)/4,0) | |
775 | ||
776 | for i,v in ipairs(orbWeld) do | |
777 | local radius = getRadius(#orbWeld) | |
778 | ||
779 | local index = x + ((math.pi*2)/#orbWeld)*(i-1) | |
780 | ||
781 | orbWeld[i].C0 = CFrame.new(radius*math.sin(index), 0, radius*math.cos(index)) | |
782 | end | |
783 | ||
784 | if (y < math.pi*2) then | |
785 | y = y + math.pi*2/128 | |
786 | else | |
787 | y = math.pi*2/128 | |
788 | end | |
789 | ||
790 | if (x < math.pi*2) then | |
791 | x = x + math.pi*2/128 | |
792 | else | |
793 | x = math.pi*2/128 | |
794 | end | |
795 | end) |