SHOW:
|
|
- or go back to the newest paste.
1 | -- Farewell Infortality. | |
2 | -- Version: 2.82 | |
3 | -- Instances: | |
4 | --FE Converter By basstracker1970 | |
5 | --Made With Gui To Lua Plugin | |
6 | local ScreenGui = Instance.new("ScreenGui") | |
7 | local TextBox = Instance.new("TextBox") | |
8 | local TextLabel = Instance.new("TextLabel") | |
9 | --Properties: | |
10 | ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") | |
11 | ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling | |
12 | ||
13 | TextBox.Parent = ScreenGui | |
14 | TextBox.BackgroundColor3 = Color3.new(0, 0.333333, 1) | |
15 | TextBox.BorderColor3 = Color3.new(0, 0.333333, 1) | |
16 | TextBox.BorderSizePixel = 0 | |
17 | TextBox.Position = UDim2.new(0.742599726, 0, 0.83808744, 0) | |
18 | TextBox.Size = UDim2.new(0, 200, 0, 50) | |
19 | TextBox.Font = Enum.Font.SourceSans | |
20 | TextBox.Text = "" | |
21 | TextBox.TextColor3 = Color3.new(0, 0, 0) | |
22 | TextBox.TextSize = 14 | |
23 | ||
24 | TextLabel.Parent = ScreenGui | |
25 | TextLabel.BackgroundColor3 = Color3.new(0, 0.333333, 1) | |
26 | TextLabel.BorderSizePixel = 0 | |
27 | TextLabel.Position = UDim2.new(0.742599726, 0, 0.758901358, 0) | |
28 | TextLabel.Size = UDim2.new(0, 200, 0, 50) | |
29 | TextLabel.Font = Enum.Font.SourceSans | |
30 | TextLabel.Text = "FE Script Converter By basstracker1970" | |
31 | TextLabel.TextColor3 = Color3.new(0, 0, 0) | |
32 | TextLabel.TextScaled = true | |
33 | TextLabel.TextSize = 14 | |
34 | TextLabel.TextWrapped = true | |
35 | -- Scripts: | |
36 | function SCRIPT_AHJG82_FAKESCRIPT() -- TextBox.Script | |
37 | local script = Instance.new('Script') | |
38 | script.Parent = TextBox | |
39 | link = script.Parent.Text | |
40 | script.Parent.FocusLost:Connect(function() | |
41 | local ScriptLink = ""..link | |
42 | ||
43 | --//Do not touch anything below this line, you may break it. | |
44 | local FeSource = nil;pcall(function()FeSource = game:GetService("HttpService"):GetAsync("https://pastebin.com/raw/V5gzxd1Z")end); | |
45 | local ScriptSource = nil;pcall(function()ScriptSource = game:GetService("HttpService"):GetAsync(ScriptLink)end); | |
46 | if not FeSource then error("Failed to grab update! Try again later.",0)end;if not ScriptSource then error("Failed to get link!",0)end; | |
47 | local FeConversion = loadstring(FeSource);local FeSucc,FeErr = pcall(FeConversion);if not FeSucc then warn(FeErr)error("Failed to initiate! Try again later.",0) end; | |
48 | local Script = loadstring(ScriptSource);local Succ,Err = pcall(Script);if not Succ then warn(Err)error("Error loading script.",0) end; | |
49 | end) | |
50 | ||
51 | end | |
52 | coroutine.resume(coroutine.create(SCRIPT_AHJG82_FAKESCRIPT)) | |
53 | wait(1)--this was so much work i did not change the animations from the last stand sorry... | |
54 | warn "Slenercat5's" | |
55 | warn "Dirty Deeds Done Dirt Cheep" | |
56 | warn "Q to call stand" | |
57 | warn "E to do far range attack" | |
58 | warn "R to make Enemy clone" | |
59 | warn "T to jump to other dimension" | |
60 | warn "Y to Make Clone" | |
61 | warn "F to use love train" | |
62 | warn "moveset based on project jojo's d4c" | |
63 | warn "Model by JojofMer" | |
64 | warn"sorry currently 1 color" | |
65 | warn "Avatar clothing and hair by Masterofroblox1206" | |
66 | plr = game.Players.LocalPlayer | |
67 | mse = plr:GetMouse() | |
68 | sound = Instance.new("Sound", game.Workspace) | |
69 | sound.SoundId = "https://www.roblox.com/asset/?id=274698941" | |
70 | sound.Volume = 10 | |
71 | canworld = true | |
72 | BeeSpeed = 50 | |
73 | ||
74 | chr=plr.Character | |
75 | tors=torso | |
76 | --[[ | |
77 | for _,v in pairs(plr.Character:GetChildren())do | |
78 | if v:IsA('Shirt') or v:IsA('Pants') or v:IsA('Accessory') then | |
79 | v:remove() | |
80 | end | |
81 | end | |
82 | local sh = Instance.new("Shirt",chr) | |
83 | sh.ShirtTemplate = "http://www.roblox.com/asset/?id=394790364" | |
84 | p=Instance.new('Pants',chr) | |
85 | p.PantsTemplate='http://www.roblox.com/asset/?id=394795102'--]] | |
86 | ||
87 | chr['Left Arm'].BrickColor=BrickColor.new('Pastel brown') | |
88 | chr['Right Arm'].BrickColor=BrickColor.new('Pastel brown') | |
89 | chr['Torso'].BrickColor=BrickColor.new('Pastel brown') | |
90 | chr.Head.BrickColor=BrickColor.new('Pastel brown') | |
91 | ||
92 | ||
93 | ||
94 | ||
95 | local Players=game:service'Players' | |
96 | local Player=Players.LocalPlayer | |
97 | local Mouse=Player:GetMouse'' | |
98 | Character=Player.Character | |
99 | ||
100 | local RenderStepped=game:service'RunService'.RenderStepped | |
101 | ||
102 | local MeshId='http://www.roblox.com/asset?id=779592805' | |
103 | local TextureId='http://www.roblox.com/asset/?id=775493027' | |
104 | ||
105 | ||
106 | local QHold=false | |
107 | local EHold=false | |
108 | ||
109 | cut = Instance.new("Sound", chr) | |
110 | cut.SoundId = "https://www.roblox.com/asset/?id=0" | |
111 | cut.Volume = 1.5 | |
112 | thri = Instance.new("Sound", chr) | |
113 | thri.SoundId = "https://www.roblox.com/asset/?id=186311262" | |
114 | thri.Volume = 2.5 | |
115 | ||
116 | ||
117 | Sound2=Instance.new('Sound') | |
118 | Sound2.SoundId='rbxassetid://616594063' | |
119 | Sound2.Parent=Player.Character.Head | |
120 | ||
121 | ||
122 | Effects = {} | |
123 | local Player = game.Players.localPlayer | |
124 | local Character = Player.Character | |
125 | Character.Archivable = true | |
126 | AdvancingFortress = Character:Clone() | |
127 | --[[ | |
128 | Hair=Instance.new('Part',Character) | |
129 | Hair.Size=Vector3.new(1,1,1) | |
130 | M=Instance.new('FileMesh',Hair) | |
131 | M.Scale=Vector3.new(.028,.028,.028) | |
132 | M.MeshId='rbxassetid://1450916371' | |
133 | M.TextureId='rbxassetid://1450916523' | |
134 | WARF=Instance.new('Weld',Hair) | |
135 | WARF.Part0=Hair | |
136 | WARF.Part1=Character.Head | |
137 | WARF.C0=CFrame.new(0,-.2,0)--]] | |
138 | ||
139 | ||
140 | --//D4cCostume | |
141 | ||
142 | function eclone(targetPart) | |
143 | ||
144 | --Converted with ttyyuu12345's model to script plugin v4 | |
145 | function sandbox(var,func) | |
146 | local env = getfenv(func) | |
147 | local newenv = setmetatable({},{ | |
148 | __index = function(self,k) | |
149 | if k=="script" then | |
150 | return var | |
151 | else | |
152 | return env[k] | |
153 | end | |
154 | end, | |
155 | }) | |
156 | setfenv(func,newenv) | |
157 | return func | |
158 | end | |
159 | cors = {} | |
160 | mas = Instance.new("Model",game:GetService("Lighting")) | |
161 | Model0 = Instance.new("Model") | |
162 | Part1 = Instance.new("Part") | |
163 | SpecialMesh2 = Instance.new("SpecialMesh") | |
164 | Decal3 = Instance.new("Decal") | |
165 | Part4 = Instance.new("Part") | |
166 | Decal5 = Instance.new("Decal") | |
167 | Motor6 = Instance.new("Motor") | |
168 | Motor7 = Instance.new("Motor") | |
169 | Motor8 = Instance.new("Motor") | |
170 | Motor9 = Instance.new("Motor") | |
171 | Motor10 = Instance.new("Motor") | |
172 | Part11 = Instance.new("Part") | |
173 | Part12 = Instance.new("Part") | |
174 | Part13 = Instance.new("Part") | |
175 | Part14 = Instance.new("Part") | |
176 | Humanoid15 = Instance.new("Humanoid") | |
177 | Humanoid15.WalkToPart=targetPart | |
178 | BodyColors16 = Instance.new("BodyColors") | |
179 | Script17 = Instance.new("Script") | |
180 | Model0.Name = "Clone" | |
181 | Model0.Parent = mas | |
182 | Model0.PrimaryPart = Part1 | |
183 | Part1.Name = "Head" | |
184 | Part1.Parent = Model0 | |
185 | Part1.BrickColor = BrickColor.new("Bright yellow") | |
186 | Part1.FormFactor = Enum.FormFactor.Symmetric | |
187 | Part1.Size = Vector3.new(2, 1, 1) | |
188 | Part1.CFrame = CFrame.new(6.34995413, 4.50001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
189 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
190 | Part1.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
191 | Part1.Position = Vector3.new(6.34995413, 4.50001717, 23.1599998) | |
192 | Part1.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
193 | SpecialMesh2.Parent = Part1 | |
194 | SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25) | |
195 | SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25) | |
196 | Decal3.Name = "face" | |
197 | Decal3.Parent = Part1 | |
198 | Decal3.Texture = "rbxasset://textures/face.png" | |
199 | Part4.Name = "Torso" | |
200 | Part4.Parent = Model0 | |
201 | Part4.BrickColor = BrickColor.new("Bright blue") | |
202 | Part4.FormFactor = Enum.FormFactor.Symmetric | |
203 | Part4.Size = Vector3.new(2, 2, 1) | |
204 | Part4.CFrame = CFrame.new(6.34995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
205 | Part4.LeftSurface = Enum.SurfaceType.Weld | |
206 | Part4.RightSurface = Enum.SurfaceType.Weld | |
207 | Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451) | |
208 | Part4.Position = Vector3.new(6.34995413, 3.00001717, 23.1599998) | |
209 | Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451) | |
210 | Decal5.Name = "roblox" | |
211 | Decal5.Parent = Part4 | |
212 | Motor6.Name = "Right Shoulder" | |
213 | Motor6.Parent = Part4 | |
214 | Motor6.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
215 | Motor6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
216 | Motor6.Part0 = Part4 | |
217 | Motor6.Part1 = Part12 | |
218 | Motor6.MaxVelocity = 0.15000000596046 | |
219 | Motor7.Name = "Left Shoulder" | |
220 | Motor7.Parent = Part4 | |
221 | Motor7.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
222 | Motor7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
223 | Motor7.Part0 = Part4 | |
224 | Motor7.Part1 = Part11 | |
225 | Motor7.MaxVelocity = 0.15000000596046 | |
226 | Motor8.Name = "Right Hip" | |
227 | Motor8.Parent = Part4 | |
228 | Motor8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
229 | Motor8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
230 | Motor8.Part0 = Part4 | |
231 | Motor8.Part1 = Part14 | |
232 | Motor8.MaxVelocity = 0.10000000149012 | |
233 | Motor9.Name = "Left Hip" | |
234 | Motor9.Parent = Part4 | |
235 | Motor9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
236 | Motor9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
237 | Motor9.Part0 = Part4 | |
238 | Motor9.Part1 = Part13 | |
239 | Motor9.MaxVelocity = 0.10000000149012 | |
240 | Motor10.Name = "Neck" | |
241 | Motor10.Parent = Part4 | |
242 | Motor10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0) | |
243 | Motor10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0) | |
244 | Motor10.Part0 = Part4 | |
245 | Motor10.Part1 = Part1 | |
246 | Motor10.MaxVelocity = 0.10000000149012 | |
247 | Part11.Name = "Left Arm" | |
248 | Part11.Parent = Model0 | |
249 | Part11.BrickColor = BrickColor.new("Bright yellow") | |
250 | Part11.CanCollide = false | |
251 | Part11.FormFactor = Enum.FormFactor.Symmetric | |
252 | Part11.Size = Vector3.new(1, 2, 1) | |
253 | Part11.CFrame = CFrame.new(4.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
254 | Part11.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
255 | Part11.Position = Vector3.new(4.84995413, 3.00001717, 23.1599998) | |
256 | Part11.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
257 | Part12.Name = "Right Arm" | |
258 | Part12.Parent = Model0 | |
259 | Part12.BrickColor = BrickColor.new("Bright yellow") | |
260 | Part12.CanCollide = false | |
261 | Part12.FormFactor = Enum.FormFactor.Symmetric | |
262 | Part12.Size = Vector3.new(1, 2, 1) | |
263 | Part12.CFrame = CFrame.new(7.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
264 | Part12.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
265 | Part12.Position = Vector3.new(7.84995413, 3.00001717, 23.1599998) | |
266 | Part12.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
267 | Part13.Name = "Left Leg" | |
268 | Part13.Parent = Model0 | |
269 | Part13.BrickColor = BrickColor.new("Br. yellowish green") | |
270 | Part13.CanCollide = false | |
271 | Part13.FormFactor = Enum.FormFactor.Symmetric | |
272 | Part13.Size = Vector3.new(1, 2, 1) | |
273 | Part13.CFrame = CFrame.new(5.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
274 | Part13.BottomSurface = Enum.SurfaceType.Smooth | |
275 | Part13.TopSurface = Enum.SurfaceType.Inlet | |
276 | Part13.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
277 | Part13.Position = Vector3.new(5.84995413, 1.00001717, 23.1599998) | |
278 | Part13.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
279 | Part14.Name = "Right Leg" | |
280 | Part14.Parent = Model0 | |
281 | Part14.BrickColor = BrickColor.new("Br. yellowish green") | |
282 | Part14.CanCollide = false | |
283 | Part14.FormFactor = Enum.FormFactor.Symmetric | |
284 | Part14.Size = Vector3.new(1, 2, 1) | |
285 | Part14.CFrame = CFrame.new(6.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
286 | Part14.BottomSurface = Enum.SurfaceType.Smooth | |
287 | Part14.TopSurface = Enum.SurfaceType.Inlet | |
288 | Part14.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
289 | Part14.Position = Vector3.new(6.84995413, 1.00001717, 23.1599998) | |
290 | Part14.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
291 | Humanoid15.Parent = Model0 | |
292 | Humanoid15.NameOcclusion = Enum.NameOcclusion.NoOcclusion | |
293 | Humanoid15.RightLeg = Part14 | |
294 | Humanoid15.LeftLeg = Part13 | |
295 | Humanoid15.Torso = Part4 | |
296 | Humanoid15.WalkToPoint=Vector3.new(0,20,0) | |
297 | BodyColors16.Parent = Model0 | |
298 | BodyColors16.HeadColor = BrickColor.new("Bright yellow") | |
299 | BodyColors16.LeftArmColor = BrickColor.new("Bright yellow") | |
300 | BodyColors16.LeftLegColor = BrickColor.new("Br. yellowish green") | |
301 | BodyColors16.RightArmColor = BrickColor.new("Bright yellow") | |
302 | BodyColors16.RightLegColor = BrickColor.new("Br. yellowish green") | |
303 | BodyColors16.TorsoColor = BrickColor.new("Bright blue") | |
304 | Script17.Name = "Full Animation" | |
305 | Script17.Parent = Model0 | |
306 | table.insert(cors,sandbox(Script17,function() | |
307 | --[[Made by Jammer622 @[http://www.roblox.com/Advanced-Player-AI-item?id=59391730], | |
308 | This is the ORIGINAL model, if you see others, they are stolen. | |
309 | Scripts mixed from vanilla Animate, Health, and Sound, | |
310 | with much custom content by myself, making them great AIs. | |
311 | No help from Miked's scripts, I made my own joint script. | |
312 | If you find any glitches, bugs, or just want to suggest an idea, please message me. | |
313 | My team works hard on these AIs, please don't make attempts to steal them. | |
314 | Your feedback is extremely appreciated! | |
315 | ||
316 | _---=CREDITS=---_ | |
317 | The Roblox Team Without them, none of this would be possible. | |
318 | Vanilla Sound | |
319 | Vanilla Health | |
320 | Vanilla Animate | |
321 | Jammer622 That's me, main programmer and weapon publisher. | |
322 | Main Developer | |
323 | Health GUI Script | |
324 | Animation Work | |
325 | Relationship Work | |
326 | Wandering | |
327 | Pathing (Map Generation) | |
328 | Weapon Usage | |
329 | Weapon (Re)Publishing | |
330 | Sonypony458 | |
331 | McDonalds Drink | |
332 | Customization | |
333 | Teamwork AI | |
334 | Model Variables | |
335 | Setting Wiki [Below] | |
336 | Macdeath I owe it to him for keeping me on track during this. | |
337 | Feature Inspiration | |
338 | Problem Solving | |
339 | Suggestions | |
340 | lah30303 Amazing pathing work goes to this fine sir. | |
341 | Pathing (Pathing Generation/System) | |
342 | ||
343 | _---=SETTINGS=---_ | |
344 | Inside this model's file, you'll find several values that can be changed. | |
345 | DropWeapon -This sets whether or not the bot will drop any equipped weapon upon dying. | |
346 | Force_Pants -This must be set through Spawners. | |
347 | Force_Shirt -This must be set through Spawners. | |
348 | Force_Weapon -This must be set through Spawners. | |
349 | Force_Hat -This must be set through Spawners. | |
350 | IgnoreCombatFF -This sets whether or not the bot will allow friendly fire during combat. | |
351 | IsAPlayer -This is a tag to specify this bot's existance to other AIs. | |
352 | IsOnTeam -This sets whether or not the bot is on a team. | |
353 | ShowTag -This sets whether or not the bot's team color name shows up beside its own. | |
354 | Team -This sets the bot's team color. | |
355 | PathTo -This is an experimental pathfinding engine. Use at your own risk! | |
356 | PrintMap -This prints maps generated when using PathTo. Use at your own risk! | |
357 | Respawn -This sets whether the bot will respawn or not upon death. | |
358 | Custom_Name -This must be set through Spawners. | |
359 | Wander -This sets whether the bot is stationary or if it moves, but not if it uses weapons or not. | |
360 | ]] | |
361 | print("Player Bot Loading") | |
362 | Delay(0, function() --Vanilla Sound | |
363 | function waitForChild(parent, childName) | |
364 | local child = parent:findFirstChild(childName) | |
365 | if child then return child end | |
366 | while true do | |
367 | child = parent.ChildAdded:wait() | |
368 | if child.Name==childName then return child end | |
369 | end | |
370 | end | |
371 | function newSound(id) | |
372 | local sound = Instance.new("Sound") | |
373 | sound.SoundId = id | |
374 | sound.archivable = false | |
375 | sound.Parent = script.Parent.Head | |
376 | return sound | |
377 | end | |
378 | local sDied = newSound("rbxasset://sounds/uuhhh.wav") | |
379 | local sFallingDown = newSound("rbxasset://sounds/splat.wav") | |
380 | local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav") | |
381 | local sGettingUp = newSound("rbxasset://sounds/hit.wav") | |
382 | local sJumping = newSound("rbxasset://sounds/button.wav") | |
383 | local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3") | |
384 | sRunning.Looped = true | |
385 | local Figure = script.Parent | |
386 | local Head = waitForChild(Figure, "Head") | |
387 | local Humanoid = waitForChild(Figure, "Humanoid") | |
388 | function onDied() | |
389 | sDied:Play() | |
390 | end | |
391 | function onState(state, sound) | |
392 | if state then | |
393 | sound:Play() | |
394 | else | |
395 | sound:Pause() | |
396 | end | |
397 | end | |
398 | function onRunning(speed) | |
399 | if speed>0 then | |
400 | sRunning:Play() | |
401 | else | |
402 | sRunning:Pause() | |
403 | end | |
404 | end | |
405 | ||
406 | Humanoid.Died:connect(onDied) | |
407 | Humanoid.Running:connect(onRunning) | |
408 | Humanoid.Jumping:connect(function(state) onState(state, sJumping) end) | |
409 | Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end) | |
410 | Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end) | |
411 | Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end) | |
412 | end) | |
413 | Delay(0, function() --Vanilla Health | |
414 | function waitForChild(parent, childName) | |
415 | local child = parent:findFirstChild(childName) | |
416 | if child then return child end | |
417 | while true do | |
418 | child = parent.ChildAdded:wait() | |
419 | if child.Name==childName then return child end | |
420 | end | |
421 | end | |
422 | local Figure = script.Parent | |
423 | local Humanoid = waitForChild(Figure, "Humanoid") | |
424 | local regening = false | |
425 | function regenHealth() | |
426 | if regening then return end | |
427 | regening = true | |
428 | while Humanoid.Health < Humanoid.MaxHealth do | |
429 | local s = wait(1) | |
430 | local health = Humanoid.Health | |
431 | if health > 0 and health < Humanoid.MaxHealth then | |
432 | local newHealthDelta = 0.01 * s * Humanoid.MaxHealth | |
433 | health = health + newHealthDelta | |
434 | Humanoid.Health = math.min(health,Humanoid.MaxHealth) | |
435 | end | |
436 | end | |
437 | if Humanoid.Health > Humanoid.MaxHealth then | |
438 | Humanoid.Health = Humanoid.MaxHealth | |
439 | end | |
440 | regening = false | |
441 | end | |
442 | Humanoid.HealthChanged:connect(regenHealth) | |
443 | end) | |
444 | Delay(0, function() --Vanilla Animate, Multiple Additions | |
445 | function waitForChild(parent, childName) | |
446 | local child = parent:findFirstChild(childName) | |
447 | if child then return child end | |
448 | while true do | |
449 | child = parent.ChildAdded:wait() | |
450 | if child.Name==childName then return child end | |
451 | end | |
452 | end | |
453 | local Figure = script.Parent | |
454 | local Clone = Figure:Clone() | |
455 | local Torso = waitForChild(Figure, "Torso") | |
456 | local Joints = Torso:GetChildren() | |
457 | for All = 1, #Joints do | |
458 | if Joints.className == "Motor" or Joints.className == "Motor6D" then | |
459 | Joints[All]:Remove() | |
460 | end | |
461 | end | |
462 | local RightShoulder = Instance.new("Motor") | |
463 | local LeftShoulder = Instance.new("Motor") | |
464 | local RightHip = Instance.new("Motor") | |
465 | local LeftHip = Instance.new("Motor") | |
466 | local Neck = Instance.new("Motor") | |
467 | local Humanoid = waitForChild(Figure, "Humanoid") | |
468 | ZStat = 1 | |
469 | ZStat2 = 0 | |
470 | local pose = "Standing" | |
471 | RightShoulder.Part0 = Torso | |
472 | RightShoulder.Part1 = Figure["Right Arm"] | |
473 | RightShoulder.MaxVelocity = 0.15 | |
474 | RightShoulder.Name = "Right Shoulder" | |
475 | RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
476 | RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
477 | RightShoulder.Parent = Torso | |
478 | LeftShoulder.Part0 = Torso | |
479 | LeftShoulder.Part1 = Figure["Left Arm"] | |
480 | LeftShoulder.MaxVelocity = 0.15 | |
481 | LeftShoulder.Name = "Left Shoulder" | |
482 | LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
483 | LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
484 | LeftShoulder.Parent = Torso | |
485 | RightHip.Part0 = Torso | |
486 | RightHip.Part1 = Figure["Right Leg"] | |
487 | RightHip.MaxVelocity = 0.1 | |
488 | RightHip.Name = "Right Hip" | |
489 | RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
490 | RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
491 | RightHip.Parent = Torso | |
492 | LeftHip.Part0 = Torso | |
493 | LeftHip.Part1 = Figure["Left Leg"] | |
494 | LeftHip.MaxVelocity = 0.1 | |
495 | LeftHip.Name = "Left Hip" | |
496 | LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
497 | LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
498 | LeftHip.Parent = Torso | |
499 | Neck.Part0 = Torso | |
500 | Neck.Part1 = Figure["Head"] | |
501 | Neck.MaxVelocity = 0.1 | |
502 | Neck.Name = "Neck" | |
503 | Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
504 | Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
505 | Neck.Parent = Torso | |
506 | local toolAnim = "None" | |
507 | local toolAnimTime = 0 | |
508 | SpawnModel = Instance.new("Model") | |
509 | function onRunning(speed) | |
510 | if speed>0 then | |
511 | pose = "Running" | |
512 | else | |
513 | pose = "Standing" | |
514 | end | |
515 | end | |
516 | function CheckTag(Tag) | |
517 | if script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then | |
518 | if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then | |
519 | if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == Tag.Value.TeamColor) or script.Parent.IsOnTeam.Value == false then | |
520 | local Tag2 = Instance.new("CFrameValue", Tag.Value.Character) | |
521 | Tag2.Name = "IsLocalEnemy" | |
522 | print(Tag.Value.Character.Name .." Has Become An Outlaw") | |
523 | end | |
524 | end | |
525 | if Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
526 | Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
527 | end | |
528 | local Found = Instance.new("CFrameValue", Tag.Value.Character) | |
529 | Found.Name = "Loc" ..script.Parent.Name | |
530 | game:GetService("Debris"):AddItem(Found, 3) | |
531 | elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Players:FindFirstChild(Tag.Value) ~= nil and game.Players[Tag.Value].Character ~= nil then | |
532 | if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then | |
533 | if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == game.Players[Tag.Value].TeamColor) or script.Parent.IsOnTeam.Value == false then | |
534 | local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character) | |
535 | Tag2.Name = "IsLocalEnemy" | |
536 | print(Tag.Value .." Has Become An Outlaw") | |
537 | end | |
538 | end | |
539 | if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
540 | game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
541 | end | |
542 | local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character) | |
543 | Found.Name = "Loc" ..script.Parent.Name | |
544 | game:GetService("Debris"):AddItem(Found, 3) | |
545 | elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then | |
546 | if game.Workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then | |
547 | if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and Workspace[Tag.Value].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value == Workspace[Tag.Value].IsOnTeam.Team.Value) or script.Parent.IsOnTeam.Value == false or Workspace[Tag.Value].IsOnTeam.Value == false then | |
548 | local Tag2 = Instance.new("CFrameValue", game.Workspace[Tag.Value]) | |
549 | Tag2.Name = "IsLocalEnemy" | |
550 | print(Tag.Value .." Has Become An Outlaw") | |
551 | end | |
552 | end | |
553 | if game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
554 | game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
555 | end | |
556 | local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value]) | |
557 | Found.Name = "Loc" ..script.Parent.Name | |
558 | game:GetService("Debris"):AddItem(Found, 3) | |
559 | elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then | |
560 | local Found = Instance.new("CFrameValue", Tag.Value.Character) | |
561 | Found.Name = "Loc" ..script.Parent.Name | |
562 | game:GetService("Debris"):AddItem(Found, 3) | |
563 | elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then | |
564 | local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value]) | |
565 | Found.Name = "Loc" ..script.Parent.Name | |
566 | game:GetService("Debris"):AddItem(Found, 3) | |
567 | end | |
568 | end | |
569 | function CheckSpawns(Object) | |
570 | local Parts = Object:GetChildren() | |
571 | for Check = 1, #Parts do | |
572 | if Parts[Check].className == "SpawnLocation" then | |
573 | local I = Instance.new("Vector3Value", SpawnModel) | |
574 | I.Value = Parts[Check].Position | |
575 | end | |
576 | CheckSpawns(Parts[Check]) | |
577 | end | |
578 | end | |
579 | function onDied() | |
580 | pose = "Dead" | |
581 | Delay(5, function() | |
582 | if script.Parent.Respawn.Value == true then | |
583 | CheckSpawns(Workspace) | |
584 | local Spawn = SpawnModel:GetChildren() | |
585 | Clone.Parent = game.Workspace | |
586 | if #Spawn > 0 then | |
587 | Spawn = Spawn[math.random(1, #Spawn)].Value | |
588 | Clone:MoveTo(Spawn) | |
589 | else | |
590 | Clone:MoveTo(Vector3.new(0, 50, 0)) | |
591 | end | |
592 | end | |
593 | Figure:Remove() | |
594 | return | |
595 | end) | |
596 | end | |
597 | function onJumping() | |
598 | pose = "Jumping" | |
599 | end | |
600 | function onClimbing() | |
601 | pose = "Climbing" | |
602 | end | |
603 | function onGettingUp() | |
604 | pose = "GettingUp" | |
605 | end | |
606 | function onFreeFall() | |
607 | pose = "FreeFall" | |
608 | end | |
609 | function onFallingDown() | |
610 | pose = "FallingDown" | |
611 | end | |
612 | function onSeated() | |
613 | pose = "Seated" | |
614 | end | |
615 | function onPlatformStanding() | |
616 | pose = "PlatformStanding" | |
617 | end | |
618 | function moveJump() | |
619 | RightShoulder.MaxVelocity = 0.5 | |
620 | LeftShoulder.MaxVelocity = 0.5 | |
621 | RightShoulder.DesiredAngle = (3.14/ZStat) | |
622 | LeftShoulder.DesiredAngle = (-3.14/ZStat) | |
623 | RightHip.DesiredAngle = (0) | |
624 | LeftHip.DesiredAngle = (0) | |
625 | end | |
626 | function moveFreeFall() | |
627 | RightShoulder.MaxVelocity = 0.5 | |
628 | LeftShoulder.MaxVelocity = 0.5 | |
629 | RightShoulder.DesiredAngle = (3.14/ZStat) | |
630 | LeftShoulder.DesiredAngle = (-3.14/ZStat) | |
631 | RightHip.DesiredAngle = (0) | |
632 | LeftHip.DesiredAngle = (0) | |
633 | end | |
634 | function moveSit() | |
635 | RightShoulder.MaxVelocity = 0.15 | |
636 | LeftShoulder.MaxVelocity = 0.15 | |
637 | RightShoulder.DesiredAngle = (3.14 /2) | |
638 | LeftShoulder.DesiredAngle = (-3.14 /2) | |
639 | RightHip.DesiredAngle = (3.14 /2) | |
640 | LeftHip.DesiredAngle = (-3.14 /2) | |
641 | end | |
642 | function getTool() | |
643 | for _, kid in ipairs(Figure:GetChildren()) do | |
644 | if kid.className == "Tool" then return kid end | |
645 | end | |
646 | return nil | |
647 | end | |
648 | function getToolAnim(tool) | |
649 | for _, c in ipairs(tool:GetChildren()) do | |
650 | if c.Name == "toolanim" and c.className == "StringValue" then | |
651 | return c | |
652 | end | |
653 | end | |
654 | return nil | |
655 | end | |
656 | function animateTool() | |
657 | if (toolAnim == "None") then | |
658 | RightShoulder.DesiredAngle = (1.57) | |
659 | return | |
660 | end | |
661 | if (toolAnim == "Slash") then | |
662 | RightShoulder.MaxVelocity = 0.5 | |
663 | RightShoulder.DesiredAngle = (0) | |
664 | return | |
665 | end | |
666 | if (toolAnim == "Lunge") then | |
667 | RightShoulder.MaxVelocity = 0.5 | |
668 | LeftShoulder.MaxVelocity = 0.5 | |
669 | RightHip.MaxVelocity = 0.5 | |
670 | LeftHip.MaxVelocity = 0.5 | |
671 | RightShoulder.DesiredAngle = (1.57) | |
672 | LeftShoulder.DesiredAngle = (1.0) | |
673 | RightHip.DesiredAngle = (1.57) | |
674 | LeftHip.DesiredAngle = (1.0) | |
675 | return | |
676 | end | |
677 | end | |
678 | function move(time) | |
679 | local amplitude | |
680 | local frequency | |
681 | if (pose == "Jumping") then | |
682 | moveJump() | |
683 | return | |
684 | end | |
685 | if (pose == "FreeFall") then | |
686 | moveFreeFall() | |
687 | return | |
688 | end | |
689 | if (pose == "Seated") then | |
690 | moveSit() | |
691 | return | |
692 | end | |
693 | local climbFudge = 0 | |
694 | if (pose == "Running") then | |
695 | RightShoulder.MaxVelocity = 0.15 | |
696 | LeftShoulder.MaxVelocity = 0.15 | |
697 | amplitude = 1 | |
698 | frequency = 9 | |
699 | elseif (pose == "Climbing") then | |
700 | RightShoulder.MaxVelocity = 0.5 | |
701 | LeftShoulder.MaxVelocity = 0.5 | |
702 | amplitude = 1 | |
703 | frequency = 9 | |
704 | climbFudge = 3.14 | |
705 | else | |
706 | amplitude = 0.1 | |
707 | frequency = 1 | |
708 | end | |
709 | desiredAngle = amplitude * math.sin(time*frequency) | |
710 | RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2 | |
711 | LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2 | |
712 | RightHip.DesiredAngle = (-desiredAngle) | |
713 | LeftHip.DesiredAngle = (-desiredAngle) | |
714 | local tool = getTool() | |
715 | if tool then | |
716 | animStringValueObject = getToolAnim(tool) | |
717 | if animStringValueObject then | |
718 | toolAnim = animStringValueObject.Value | |
719 | animStringValueObject.Parent = nil | |
720 | toolAnimTime = time + .3 | |
721 | end | |
722 | if time > toolAnimTime then | |
723 | toolAnimTime = 0 | |
724 | toolAnim = "None" | |
725 | end | |
726 | animateTool() | |
727 | else | |
728 | toolAnim = "None" | |
729 | toolAnimTime = 0 | |
730 | end | |
731 | end | |
732 | Humanoid.Died:connect(onDied) | |
733 | Humanoid.Running:connect(onRunning) | |
734 | Humanoid.Jumping:connect(onJumping) | |
735 | Humanoid.Climbing:connect(onClimbing) | |
736 | Humanoid.GettingUp:connect(onGettingUp) | |
737 | Humanoid.FreeFalling:connect(onFreeFall) | |
738 | Humanoid.FallingDown:connect(onFallingDown) | |
739 | Humanoid.Seated:connect(onSeated) | |
740 | Humanoid.PlatformStanding:connect(onPlatformStanding) | |
741 | Humanoid.ChildAdded:connect(CheckTag) | |
742 | OriginalTime = 0.1 | |
743 | Time = OriginalTime | |
744 | while Figure.Parent~=nil do | |
745 | Time = Time + 0.1 | |
746 | wait(OriginalTime) | |
747 | move(Time) | |
748 | end | |
749 | end) | |
750 | Delay(0, function() --lah30303's Pathing Script | |
751 | function CalcMoves(map, px, py, tx, ty) | |
752 | if map[ty][tx] ~= 0 then | |
753 | return nil | |
754 | end | |
755 | local openlist, closedlist, listk, closedk, tempH, tempG, xsize, ysize, curbase = {}, {}, 1, 0, math.abs(px - tx) + math.abs(py - ty), 0, #map[1], #map, {} | |
756 | openlist[1] = {x = px, y = py, g = 0, h = tempH, f = 0 + tempH ,par = 1} | |
757 | local nodenumber = 0 | |
758 | while listk > 0 do | |
759 | nodenumber = nodenumber + 1 | |
760 | if nodenumber / ScanSkip == math.floor(nodenumber / ScanSkip) then | |
761 | wait() | |
762 | if DebugPathing == true then | |
763 | print("Node", nodenumber) | |
764 | end | |
765 | end | |
766 | closedk = closedk + 1 | |
767 | table.insert(closedlist, closedk, openlist[1]) | |
768 | curbase = closedlist[closedk] | |
769 | if closedlist[closedk].x == tx and closedlist[closedk].y == ty then | |
770 | return closedlist | |
771 | end | |
772 | openlist[1] = openlist[listk] | |
773 | table.remove(openlist, listk) | |
774 | listk = listk - 1 | |
775 | local v = 1 | |
776 | while true do | |
777 | local u = v | |
778 | if 2 * u + 1 <= listk then | |
779 | if openlist[u].f >= openlist[2 * u].f then | |
780 | v = 2 * u | |
781 | end | |
782 | if openlist[v].f >= openlist[2 * u + 1].f then | |
783 | v = 2 * u + 1 | |
784 | end | |
785 | elseif 2 * u <= listk then | |
786 | if openlist[u].f >= openlist[2 * u].f then | |
787 | v = 2 * u | |
788 | end | |
789 | end | |
790 | if u ~= v then | |
791 | local temp = openlist[u] | |
792 | openlist[u] = openlist[v] | |
793 | openlist[v] = temp | |
794 | else | |
795 | break | |
796 | end | |
797 | end | |
798 | ||
799 | local tocheck = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}} --[1]Right, [2]Left, [3]Down, [4]Up, [5]UpLeft, [6]UpRight, [7]DownLeft, [8]DownRight | |
800 | if closedk > 0 then | |
801 | for k = 1, closedk do | |
802 | for i, v in pairs(tocheck) do | |
803 | if closedlist[k].x == curbase.x + v[1] and closedlist[k].y == curbase.y + v[2] then | |
804 | tocheck[i] = nil | |
805 | end | |
806 | end | |
807 | end | |
808 | end | |
809 | for i, v in pairs(tocheck) do | |
810 | local a = curbase.x + v[1] | |
811 | local b = curbase.y + v[2] | |
812 | if a > xsize or a < 1 or b > ysize or b < 1 then | |
813 | tocheck[i] = nil | |
814 | end | |
815 | end | |
816 | for i, v in pairs(tocheck) do | |
817 | local a, b = curbase.x + v[1], curbase.y + v[2] | |
818 | if a <= xsize and a >= 1 and b <= ysize and b >= 1 and map[b][a] ~= 0 then | |
819 | tocheck[i] = nil | |
820 | end | |
821 | end | |
822 | tempG = curbase.g + 1 | |
823 | tempDiagG = curbase.g + 1.4 | |
824 | for k = 1, listk do | |
825 | for i, v in pairs(tocheck) do | |
826 | if openlist[k].x == curbase.x + v[1] and openlist[k].y == curbase.y + 1 and openlist[k].g > tempG then | |
827 | tempH = math.abs((curbase.x + v[1])-tx) + math.abs((curbase.y + v[1])-ty) | |
828 | table.insert(openlist, k, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG + tempH, par = closedk}) | |
829 | local m = k | |
830 | while m ~= 1 do | |
831 | if openlist[m].f <= openlist[math.floor(m/2)].f then | |
832 | temp = openlist[math.floor(m/2)] | |
833 | openlist[math.floor(m/2)] = openlist[m] | |
834 | openlist[m] = temp | |
835 | m = math.floor(m/2) | |
836 | else | |
837 | break | |
838 | end | |
839 | tocheck[i] = nil | |
840 | end | |
841 | end | |
842 | end | |
843 | end | |
844 | for i, v in pairs(tocheck) do | |
845 | listk = listk + 1 | |
846 | tempH = math.abs((curbase.x + v[1]) - tx) + math.abs((curbase.y + v[2]) - ty) | |
847 | table.insert(openlist, listk, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG+tempH, par = closedk}) | |
848 | m = listk | |
849 | while m ~= 1 do | |
850 | if openlist[m].f <= openlist[math.floor(m/2)].f then | |
851 | temp = openlist[math.floor(m/2)] | |
852 | openlist[math.floor(m/2)] = openlist[m] | |
853 | openlist[m] = temp | |
854 | m = math.floor(m/2) | |
855 | else | |
856 | break | |
857 | end | |
858 | end | |
859 | end | |
860 | end | |
861 | return nil | |
862 | end | |
863 | ||
864 | ||
865 | function CalcPath(closedlist) | |
866 | ||
867 | if closedlist == nil or table.getn(closedlist) == 1 then | |
868 | return nil | |
869 | end | |
870 | local path = {} | |
871 | local pathIndex = {} | |
872 | local last = table.getn(closedlist) | |
873 | table.insert(pathIndex,1,last) | |
874 | ||
875 | local i = 1 | |
876 | while pathIndex[i] > 1 do | |
877 | i = i + 1 | |
878 | table.insert(pathIndex, i, closedlist[pathIndex[i - 1]].par) | |
879 | end | |
880 | ||
881 | for n = table.getn(pathIndex) - 1, 1, -1 do | |
882 | table.insert(path, {x = closedlist[pathIndex[n]].x, y = closedlist[pathIndex[n]].y}) | |
883 | end | |
884 | ||
885 | closedlist = nil | |
886 | return path | |
887 | end | |
888 | end) | |
889 | Delay(0, function() --Main Artificial Intelligence Scripting/Path Grid Generator | |
890 | local Base | |
891 | if script.Parent:FindFirstChild("BASE") == nil then | |
892 | Base = Instance.new("Part") | |
893 | Base.Transparency = 1 | |
894 | Base.TopSurface = "Smooth" | |
895 | Base.BottomSurface = "Smooth" | |
896 | Base.CanCollide = false | |
897 | Base.Anchored = true | |
898 | Base.Locked = true | |
899 | Base.BrickColor = BrickColor.new(0, 0, 0) | |
900 | Base.Name = "BASE" | |
901 | Base.CFrame = CFrame.new(Vector3.new(0, 0, 0)) | |
902 | Base.Parent = script.Parent | |
903 | else | |
904 | Base = script.Parent.BASE | |
905 | Base.CFrame = CFrame.new(Vector3.new(0, 0, 0)) | |
906 | end | |
907 | function Jump() | |
908 | script.Parent.Humanoid.Jump = true | |
909 | end | |
910 | function Check(Hit) | |
911 | if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent.Parent ~= nil then | |
912 | if Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil then | |
913 | Jump() | |
914 | end | |
915 | end | |
916 | end | |
917 | script.Parent.Torso.Touched:connect(Check) | |
918 | function Prep(Target, Current, Attempts) | |
919 | if Attempts == nil then | |
920 | Attempts = 1000 | |
921 | end | |
922 | local Hit = false | |
923 | local Tag = Base:Clone() | |
924 | Tag.Position = Target | |
925 | Tag.Parent = script.Parent | |
926 | local TagRay = Ray.new(Tag.CFrame.p, (CFrame.new(Tag.CFrame.p - Vector3.new(0, 3, 0)).p - Tag.CFrame.p).Unit * 40) | |
927 | local TRHit, TRPos = game.Workspace:FindPartOnRay(TagRay, script.Parent) | |
928 | if TRHit ~= nil then | |
929 | Hit = true | |
930 | end | |
931 | if Tag.Parent ~= nil then | |
932 | Tag:Remove() | |
933 | end | |
934 | if Hit == false and Attempts > 0 and script.Parent.Wander.Value == true then | |
935 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1) | |
936 | elseif script.Parent.Wander.Value == true then | |
937 | local TargetRay = Ray.new(script.Parent.Torso.CFrame.p, (CFrame.new(Target).p - script.Parent.Torso.CFrame.p).Unit * ((Target - script.Parent.Torso.Position).Magnitude - 3)) | |
938 | local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, script.Parent) | |
939 | local TrueTarget = script.Parent.Torso.Position | |
940 | if THit ~= nil then | |
941 | for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - TPos).Magnitude) do | |
942 | local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (TPos - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3) | |
943 | local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent) | |
944 | if TH2 ~= nil and TH2.Name ~= "Lava" then | |
945 | TrueTarget = TP2 | |
946 | else | |
947 | break | |
948 | end | |
949 | end | |
950 | else | |
951 | for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - Target).Magnitude) do | |
952 | local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (Target - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3) | |
953 | local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent) | |
954 | if TH2 ~= nil and TH2.Name ~= "Lava" then | |
955 | TrueTarget = TP2 | |
956 | else | |
957 | break | |
958 | end | |
959 | end | |
960 | end | |
961 | script.Parent.Humanoid:MoveTo(TrueTarget, Current) | |
962 | end | |
963 | end | |
964 | function ZHit(Part) | |
965 | if script.Parent:FindFirstChild("IsAZombie") ~= nil and script.Parent.Humanoid.Health > 0 and Part ~= nil and Part.Parent ~= nil and Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent:FindFirstChild("IsAZombie") == nil then | |
966 | Part.Parent.Humanoid:TakeDamage(2) | |
967 | script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + 1 | |
968 | script.Parent.Humanoid:TakeDamage(-1) | |
969 | end | |
970 | end | |
971 | script.Parent["Right Arm"].Touched:connect(ZHit) | |
972 | script.Parent["Left Arm"].Touched:connect(ZHit) | |
973 | CurrentMap = {} | |
974 | MapMask = {} | |
975 | MapVar = {0, 0, 0, 0, 0} | |
976 | BlockScanned = 0 | |
977 | ScanSkip = 5 | |
978 | DebugPathing = true | |
979 | function GenerateMap(PathPos) | |
980 | CurrentMap = {} | |
981 | MapMask = {} | |
982 | MapVar = {0, 0, 0, 0, 0} | |
983 | BlockScanned = 0 | |
984 | MapVariables = ScanParts(Workspace, 1) | |
985 | for MapX = 1, math.max(-MapVariables[1], MapVariables[2]) * 2 + 1 do | |
986 | CurrentMap[MapX] = {} | |
987 | for MapY = 1, math.max(-MapVariables[3], MapVariables[4]) * 2 + 1 do | |
988 | CurrentMap[MapX][MapY] = 0 | |
989 | end | |
990 | end | |
991 | for MaskX = 1, #CurrentMap do | |
992 | MapMask[MaskX] = {} | |
993 | for MaskY = 1, #CurrentMap[MaskX] do | |
994 | MapMask[MaskX][MaskY] = {MapVariables[1] + MaskX - 0.5, MapVariables[1] + MaskY - 0.5} | |
995 | end | |
996 | end | |
997 | ScanParts(Workspace, 2, MapVariables) | |
998 | wait(1) | |
999 | if script.Parent.PrintMap.Value == true then | |
1000 | print("Printing Map...") | |
1001 | for ClearPrint = 1, 250 do | |
1002 | wait() | |
1003 | print() | |
1004 | end | |
1005 | for PrintX = 1, #CurrentMap do | |
1006 | local PrintZ = "" | |
1007 | for PrintY = 1, #CurrentMap[PrintX] do | |
1008 | PrintZ = PrintZ ..CurrentMap[PrintX][PrintY] | |
1009 | end | |
1010 | print(PrintZ) | |
1011 | wait(0.1) | |
1012 | end | |
1013 | end | |
1014 | local MapCoords = {0, 0, 0, 0} | |
1015 | local Distance = math.huge | |
1016 | for MPX = 1, #CurrentMap do | |
1017 | for MPY = 1, #CurrentMap[MPX] do | |
1018 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude < Distance then | |
1019 | MapCoords = {MPX, MPY, 0, 0} | |
1020 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude | |
1021 | end | |
1022 | end | |
1023 | end | |
1024 | local Distance = math.huge | |
1025 | for MPX = 1, #CurrentMap do | |
1026 | for MPY = 1, #CurrentMap[MPX] do | |
1027 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude < Distance then | |
1028 | MapCoords = {MapCoords[1], MapCoords[2], math.min(MPX, #CurrentMap) - 1, math.min(MPY, #CurrentMap[1] - 1)} | |
1029 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude | |
1030 | end | |
1031 | end | |
1032 | end | |
1033 | for i, v in pairs(CalcPath(CalcMoves(CurrentMap, MapCoords[1], MapCoords[2], MapCoords[3], MapCoords[4]))) do | |
1034 | local Timer = 20 | |
1035 | local pX = v["x"] | |
1036 | local pY = v["y"] | |
1037 | local pTo = Vector3.new(MapMask[pX][pY][1], 0, MapMask[pX][pY][2]) | |
1038 | pTo = pTo + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit | |
1039 | while (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do | |
1040 | script.Parent.Humanoid:MoveTo(pTo, Base) | |
1041 | Timer = Timer - 1 | |
1042 | if Timer == 10 then | |
1043 | script.Parent.Humanoid.Jump = true | |
1044 | end | |
1045 | wait(0.1) | |
1046 | end | |
1047 | if Timer == 0 then | |
1048 | if (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude <= 5 then | |
1049 | script.Parent.Torso.CFrame = script.Parent.Torso.CFrame + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit * (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude | |
1050 | else | |
1051 | break | |
1052 | end | |
1053 | end | |
1054 | end | |
1055 | end | |
1056 | function ScanParts(CurrentModel, CurrentStage, Variables) | |
1057 | local X = CurrentModel:GetChildren() | |
1058 | for I = 1, #X do | |
1059 | if #X[I]:GetChildren() > 0 then | |
1060 | ScanParts(X[I], 1, Variables) | |
1061 | end | |
1062 | if X[I].ClassName == "Part" or X[I].ClassName == "WedgePart" or X[I].ClassName == "CornerWedgePart" or X[I].ClassName == "TrussPart" or X[I].ClassName == "SpawnLocation" or X[I].ClassName == "Seat" or X[I].ClassName == "VehicleSeat" or X[I].ClassName == "SkateboardPlatform" then | |
1063 | BlockScanned = BlockScanned + 1 | |
1064 | if BlockScanned / ScanSkip == math.floor(BlockScanned / ScanSkip) then | |
1065 | wait() | |
1066 | if DebugPathing == true then | |
1067 | print("Block", BlockScanned) | |
1068 | end | |
1069 | end | |
1070 | if CurrentStage == 1 then | |
1071 | MapVar[1] = math.min(math.ceil(X[I].Position.X - X[I].Size.X / 2), MapVar[1]) | |
1072 | MapVar[2] = math.max(math.floor(X[I].Position.X + X[I].Size.X / 2), MapVar[2]) | |
1073 | MapVar[3] = math.min(math.ceil(X[I].Position.Z - X[I].Size.Z / 2), MapVar[3]) | |
1074 | MapVar[4] = math.max(math.floor(X[I].Position.Z + X[I].Size.Z / 2), MapVar[4]) | |
1075 | elseif CurrentStage == 2 and ((X[I].Position.Y + X[I].Size.Y / 2 > script.Parent.Torso.Position.Y + 2 and X[I].Position.Y - X[I].Size.Y / 2 < script.Parent.Torso.Position.Y + 2) or X[I].Position.Y + X[I].Size.Y / 2 < script.Parent.Torso.Position.Y - 8) then | |
1076 | local BlockStart = {X[I].Position.X - X[I].Size.X / 2, X[I].Position.Z - X[I].Size.Z / 2} | |
1077 | local BlockEnd = {X[I].Position.X + X[I].Size.X / 2, X[I].Position.Z + X[I].Size.Z / 2} | |
1078 | local BlockCoords = {0, 0, 0, 0} | |
1079 | local Distance = math.huge | |
1080 | for MPX = 1, #CurrentMap do | |
1081 | for MPY = 1, #CurrentMap[MPX] do | |
1082 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude < Distance then | |
1083 | BlockCoords = {MPX, MPY, 0, 0} | |
1084 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude | |
1085 | end | |
1086 | end | |
1087 | end | |
1088 | local Distance = math.huge | |
1089 | for MPX = 1, #CurrentMap do | |
1090 | for MPY = 1, #CurrentMap[MPX] do | |
1091 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude < Distance then | |
1092 | BlockCoords = {BlockCoords[1], BlockCoords[2], MPX, MPY} | |
1093 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude | |
1094 | end | |
1095 | end | |
1096 | end | |
1097 | for XGrid = BlockCoords[2], BlockCoords[4] do | |
1098 | for YGrid = BlockCoords[1], BlockCoords[3] do | |
1099 | CurrentMap[XGrid][YGrid] = 1 | |
1100 | end | |
1101 | end | |
1102 | end | |
1103 | end | |
1104 | end | |
1105 | if CurrentStage == 1 then | |
1106 | MapVar[5] = {MapVar[1] + MapVar[2] / 2, MapVar[3] + MapVar[4] / 2} | |
1107 | return MapVar | |
1108 | end | |
1109 | end | |
1110 | IsInCombat = false | |
1111 | while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") == nil do | |
1112 | local Distance = 100 | |
1113 | local Target = nil | |
1114 | IsInCombat = false | |
1115 | local Players = Workspace:GetChildren() | |
1116 | for Check = 1, #Players do | |
1117 | if Players[Check] ~= script.Parent and ((Players[Check]:FindFirstChild("Humanoid") ~= nil and (Players[Check]:FindFirstChild("IsAZombie") ~= nil or Players[Check]:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or (script.Parent.IsOnTeam.Value == true and Players[Check]:FindFirstChild("IsOnTeam") ~= nil and Players[Check].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value ~= Players[Check].IsOnTeam.Team.Value) or (game.Players:GetPlayerFromCharacter(Players[Check]) ~= nil and script.Parent.IsOnTeam.Value == true and game.Players:GetPlayerFromCharacter(Players[Check]).Neutral == false and game.Players:GetPlayerFromCharacter(Players[Check]).TeamColor ~= script.Parent.IsOnTeam.Team.Value)) and Players[Check].Humanoid.Health > 0) or (Players[Check]:FindFirstChild("Zombie") ~= nil and Players[Check].Zombie.ClassName == "Humanoid" and Players[Check].Zombie.Health > 0)) and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then | |
1118 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
1119 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
1120 | if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then | |
1121 | local TeamTag = nil | |
1122 | local Parts = Players[Check]:GetChildren() | |
1123 | for X = 1, #Parts do | |
1124 | if Parts[X].Name == "TeamLoc" then | |
1125 | if Parts[X].Value == script.Parent.IsOnTeam.Team.Value then | |
1126 | TeamTag = Parts[X] | |
1127 | end | |
1128 | end | |
1129 | end | |
1130 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil or Parts[X] ~= nil or (Players[Check].Torso.Position - (script.Parent.Torso.Position + script.Parent.Torso.CFrame.lookVector * 50)).Magnitude <= 52 then | |
1131 | if script.Parent.IsOnTeam.Value == false then | |
1132 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
1133 | Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
1134 | end | |
1135 | local Found = Instance.new("CFrameValue", Players[Check]) | |
1136 | Found.Name = "Loc" ..script.Parent.Name | |
1137 | game:GetService("Debris"):AddItem(Found, 3) | |
1138 | else | |
1139 | if Parts[X] ~= nil then | |
1140 | Parts[X]:Remove() | |
1141 | end | |
1142 | local Found = Instance.new("BrickColorValue", Players[Check]) | |
1143 | Found.Name = "TeamLoc" | |
1144 | Found.Value = script.Parent.IsOnTeam.Team.Value | |
1145 | game:GetService("Debris"):AddItem(Found, 3) | |
1146 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
1147 | Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
1148 | end | |
1149 | local Found = Instance.new("CFrameValue", Players[Check]) | |
1150 | Found.Name = "Loc" ..script.Parent.Name | |
1151 | game:GetService("Debris"):AddItem(Found, 3) | |
1152 | end | |
1153 | end | |
1154 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
1155 | Target = Players[Check].Torso | |
1156 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
1157 | end | |
1158 | end | |
1159 | end | |
1160 | end | |
1161 | if Target == nil then | |
1162 | local HasTool = false | |
1163 | local ToolCheck = script.Parent:GetChildren() | |
1164 | for Check = 1, #ToolCheck do | |
1165 | if ToolCheck[Check].ClassName == "Tool" then | |
1166 | HasTool = true | |
1167 | end | |
1168 | end | |
1169 | if HasTool == false then | |
1170 | Distance = 100 | |
1171 | for Check = 1, #Players do | |
1172 | if Players[Check].ClassName == "Tool" and Players[Check]:FindFirstChild("Handle") ~= nil and Players[Check]:FindFirstChild("Active") ~= nil and Players[Check]:FindFirstChild("TargetPos") ~= nil and Players[Check]:FindFirstChild("Type") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
1173 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
1174 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
1175 | if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then | |
1176 | Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude | |
1177 | Target = Players[Check] | |
1178 | end | |
1179 | end | |
1180 | end | |
1181 | if Target ~= nil and Target.ClassName == "Tool" then | |
1182 | if Distance <= 5 and HasTool == false then | |
1183 | Target.Parent = script.Parent | |
1184 | HasTool = true | |
1185 | else | |
1186 | Prep(Target.Handle.Position, Base) | |
1187 | end | |
1188 | else | |
1189 | for Check = 1, #Players do | |
1190 | if Players[Check].Name == "Crate" and Players[Check]:FindFirstChild("OpenCrate") ~= nil and Players[Check].OpenCrate.Value == false and (Players[Check].Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
1191 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
1192 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
1193 | if Hit ~= nil and Hit == Players[Check] then | |
1194 | Target = Players[Check] | |
1195 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
1196 | end | |
1197 | end | |
1198 | end | |
1199 | if Target ~= nil then | |
1200 | script.Parent.Humanoid:MoveTo(Target.Position, Target) | |
1201 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then | |
1202 | Target.OpenCrate.Value = true | |
1203 | end | |
1204 | else | |
1205 | local HasHat = false | |
1206 | local HatCheck = script.Parent:GetChildren() | |
1207 | for Check = 1, #HatCheck do | |
1208 | if ToolCheck[Check].ClassName == "Hat" then | |
1209 | HasHat = true | |
1210 | end | |
1211 | end | |
1212 | if HasHat == false then | |
1213 | Distance = 100 | |
1214 | for Check = 1, #Players do | |
1215 | if Players[Check].ClassName == "Hat" and Players[Check]:FindFirstChild("Handle") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
1216 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
1217 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
1218 | if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then | |
1219 | Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude | |
1220 | Target = Players[Check] | |
1221 | end | |
1222 | end | |
1223 | end | |
1224 | if Target ~= nil and Target.ClassName == "Hat" then | |
1225 | if Distance <= 5 and HasHat == false then | |
1226 | Target.Parent = script.Parent | |
1227 | HasHat = true | |
1228 | else | |
1229 | Prep(Target.Handle.Position, Base) | |
1230 | end | |
1231 | else | |
1232 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
1233 | if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then | |
1234 | GenerateMap(script.Parent.PathTo.Value) | |
1235 | script.Parent.PathTo.Value = Vector3.new(0, 0, 0) | |
1236 | elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
1237 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
1238 | end | |
1239 | else | |
1240 | Jump() | |
1241 | end | |
1242 | end | |
1243 | end | |
1244 | end | |
1245 | end | |
1246 | else | |
1247 | if Target == nil then | |
1248 | local Distance = 80 | |
1249 | local Players = Workspace:GetChildren() | |
1250 | for Check = 1, #Players do | |
1251 | if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check] ~= script.Parent and Players[Check]:FindFirstChild("IsLocalEnemy") == nil and Players[Check]:FindFirstChild("Leader") ~= nil and Players[Check].Humanoid.Health > 0 and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
1252 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
1253 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
1254 | if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then | |
1255 | Target = Players[Check].Torso | |
1256 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
1257 | end | |
1258 | end | |
1259 | end | |
1260 | if Target ~= nil then | |
1261 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 10 | |
1262 | Prep(Position, Base) | |
1263 | else | |
1264 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
1265 | if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then | |
1266 | GenerateMap(script.Parent.PathTo.Value) | |
1267 | script.Parent.PathTo.Value = Vector3.new(0, 0, 0) | |
1268 | elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
1269 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
1270 | end | |
1271 | else | |
1272 | Jump() | |
1273 | end | |
1274 | end | |
1275 | else | |
1276 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
1277 | if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then | |
1278 | GenerateMap(script.Parent.PathTo.Value) | |
1279 | script.Parent.PathTo.Value = Vector3.new(0, 0, 0) | |
1280 | elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
1281 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
1282 | end | |
1283 | else | |
1284 | Jump() | |
1285 | end | |
1286 | end | |
1287 | end | |
1288 | else | |
1289 | local Weapon = nil | |
1290 | local ToolCheck = script.Parent:GetChildren() | |
1291 | for Check = 1, #ToolCheck do | |
1292 | if ToolCheck[Check].ClassName == "Tool" then | |
1293 | Weapon = ToolCheck[Check] | |
1294 | end | |
1295 | end | |
1296 | if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then | |
1297 | if Weapon.Type.Value == "Melee" then | |
1298 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
1299 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then | |
1300 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1301 | Weapon.Active.Value = true | |
1302 | end | |
1303 | elseif Weapon.Type.Value == "Melee/Ranged" then | |
1304 | if Distance <= 10 then | |
1305 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
1306 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1307 | Weapon.Active.Value = true | |
1308 | else | |
1309 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Base) | |
1310 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 50 then | |
1311 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1312 | Weapon.Active.Value = true | |
1313 | end | |
1314 | end | |
1315 | elseif Weapon.Type.Value == "Melee/RangedMed" then | |
1316 | if Distance <= 10 then | |
1317 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
1318 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1319 | Weapon.Active.Value = true | |
1320 | else | |
1321 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base) | |
1322 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 40 then | |
1323 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1324 | Weapon.Active.Value = true | |
1325 | end | |
1326 | end | |
1327 | elseif Weapon.Type.Value == "Melee/RangedClose" then | |
1328 | if Distance <= 10 then | |
1329 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
1330 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1331 | Weapon.Active.Value = true | |
1332 | else | |
1333 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Base) | |
1334 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 30 then | |
1335 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1336 | Weapon.Active.Value = true | |
1337 | end | |
1338 | end | |
1339 | elseif Weapon.Type.Value == "Ranged" then | |
1340 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base) | |
1341 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1342 | wait() | |
1343 | Weapon.Active.Value = true | |
1344 | elseif Weapon.Type.Value == "RangedMed" then | |
1345 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 60, Base) | |
1346 | if Distance <= 70 then | |
1347 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1348 | wait() | |
1349 | Weapon.Active.Value = true | |
1350 | end | |
1351 | elseif Weapon.Type.Value == "RangedClose" then | |
1352 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base) | |
1353 | if Distance <= 40 then | |
1354 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1355 | wait() | |
1356 | Weapon.Active.Value = true | |
1357 | end | |
1358 | elseif Weapon.Type.Value == "RangedAngle" and Distance <= 100 then | |
1359 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * (script.Parent.Torso.Position - Target.Position).Magnitude + Target.Velocity | |
1360 | script.Parent.Humanoid:MoveTo(Position, Base) | |
1361 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1362 | wait() | |
1363 | Weapon.Active.Value = true | |
1364 | elseif Weapon.Type.Value == "RangedTactical" then | |
1365 | if Distance <= 30 then | |
1366 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 50 | |
1367 | Prep(Position, Base) | |
1368 | elseif Distance >= 50 then | |
1369 | Prep(Target.Position, Target) | |
1370 | end | |
1371 | if Distance <= 50 and Distance >= 30 then | |
1372 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Target.Parent.Torso) | |
1373 | end | |
1374 | if Distance <= 60 then | |
1375 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1376 | wait() | |
1377 | Weapon.Active.Value = true | |
1378 | end | |
1379 | elseif Weapon.Type.Value == "Shuriken" then | |
1380 | if Distance <= 15 then | |
1381 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20 | |
1382 | Prep(Position, Base) | |
1383 | elseif Distance >= 30 then | |
1384 | Prep(Target.Position, Target) | |
1385 | end | |
1386 | if Distance <= 30 and Distance >= 15 then | |
1387 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Target.Parent.Torso) | |
1388 | end | |
1389 | if Distance <= 50 then | |
1390 | Weapon.TargetPos.Value = (Target.Position + Target.Velocity / 2) + Vector3.new(math.random(-2, 2), math.random(-2, 2) + ((Target.Position + Target.Velocity / 2) - script.Parent.Torso.Position).Magnitude / 8, math.random(-2, 2)) | |
1391 | wait() | |
1392 | Weapon.Active.Value = true | |
1393 | end | |
1394 | elseif Weapon.Type.Value == "HealDrink" then | |
1395 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120 | |
1396 | Prep(Position, Base) | |
1397 | if script.Parent.Humanoid.Health < script.Parent.Humanoid.MaxHealth then | |
1398 | Weapon.Active.Value = true | |
1399 | end | |
1400 | elseif Weapon.Type.Value == "GrenadeDirect" then | |
1401 | if Distance >= 80 and Distance <= 100 then | |
1402 | Prep(Target.Position, Target) | |
1403 | wait(0.5) | |
1404 | Weapon.Active.Value = true | |
1405 | wait(0.5) | |
1406 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100 | |
1407 | Prep(Position, Base) | |
1408 | else | |
1409 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100 | |
1410 | Prep(Position, Base) | |
1411 | end | |
1412 | elseif Weapon.Type.Value == "Bomb" then | |
1413 | if Distance > 10 then | |
1414 | Prep(Target.Position, Target) | |
1415 | elseif Distance <= 10 then | |
1416 | Weapon.Active.Value = true | |
1417 | wait(2) | |
1418 | while Weapon ~= nil and Weapon:FindFirstChild("Handle") ~= nil and Weapon.Handle.Transparency == 1 do | |
1419 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base) | |
1420 | wait(0.5) | |
1421 | end | |
1422 | end | |
1423 | elseif Weapon.Type.Value == "Backstab" then | |
1424 | if Distance >= 10 then | |
1425 | if (script.Parent.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then | |
1426 | Prep(Target.Position, Target) | |
1427 | else | |
1428 | if (script.Parent.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then | |
1429 | Prep(Target.Position, Base) | |
1430 | local backstab_time = 20 | |
1431 | while backstab_time > 1 and (script.Parent.Torso.Position - Target.Position).Magnitude >= 4 do | |
1432 | wait(0.1) | |
1433 | backstab_time = backstab_time - 1 | |
1434 | end | |
1435 | if (script.Parent.Torso.Position - Target.Position).Magnitude < 4 then | |
1436 | Weapon.Active.Value = true | |
1437 | end | |
1438 | else | |
1439 | Prep(Target.Position - Target.CFrame.lookVector * 15, Base) | |
1440 | end | |
1441 | end | |
1442 | else | |
1443 | Prep(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target) | |
1444 | if Distance <= 5 then | |
1445 | Weapon.Active.Value = true | |
1446 | end | |
1447 | end | |
1448 | elseif Weapon.Type.Value == "Crossbow" then | |
1449 | if Distance > 80 then | |
1450 | Prep(Target.Position, Target) | |
1451 | elseif Distance < 40 then | |
1452 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100, Base) | |
1453 | elseif Distance <= 80 and Distance >= 40 then | |
1454 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * ((script.Parent.Torso.Position - Target.Position).Magnitude - 5), Base) | |
1455 | wait(0.2) | |
1456 | Weapon.TargetPos.Value = Target.Position + Target.Velocity / 8 + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
1457 | Weapon.Active.Value = true | |
1458 | end | |
1459 | end | |
1460 | IsInCombat = true | |
1461 | elseif Distance <= 100 then | |
1462 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120 | |
1463 | Prep(Position, Base) | |
1464 | end | |
1465 | end | |
1466 | if IsInCombat == true then | |
1467 | wait(0.2) | |
1468 | else | |
1469 | wait(0.6) | |
1470 | end | |
1471 | end | |
1472 | local Weapon = nil | |
1473 | local ToolCheck = script.Parent:GetChildren() | |
1474 | for Check = 1, #ToolCheck do | |
1475 | if ToolCheck[Check].ClassName == "Tool" then | |
1476 | Weapon = ToolCheck[Check] | |
1477 | end | |
1478 | end | |
1479 | if Weapon ~= nil and script.Parent.DropWeapon.Value == true then | |
1480 | Weapon.Parent = Workspace | |
1481 | elseif Weapon ~= nil then | |
1482 | Weapon:Remove() | |
1483 | end | |
1484 | if script.Parent:FindFirstChild("IsAZombie") ~= nil then | |
1485 | script.Parent.Name = "New Zombie" | |
1486 | script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100))) | |
1487 | wait() | |
1488 | script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth | |
1489 | script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + math.random(math.random(-200, 0), math.random(100, math.random(200, 300))) / 100 | |
1490 | ZStat = 2 | |
1491 | ZStat2 = 1.57 | |
1492 | Delay(1, function() | |
1493 | while script.Parent:FindFirstChild("Humanoid") ~= nil and script.Parent.Humanoid.Health > 0 do | |
1494 | script.Parent.Humanoid.MaxHealth = math.max(0, script.Parent.Humanoid.MaxHealth - 1) | |
1495 | script.Parent.Humanoid.Health = math.min(script.Parent.Humanoid.Health, script.Parent.Humanoid.MaxHealth) | |
1496 | wait(1) | |
1497 | end | |
1498 | end) | |
1499 | while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") ~= nil do | |
1500 | local Distance = 100 | |
1501 | local Target = nil | |
1502 | local Players = Workspace:GetChildren() | |
1503 | for Check = 1, #Players do | |
1504 | if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check]:FindFirstChild("Torso") ~= nil and Players[Check]:FindFirstChild("IsAZombie") == nil and Players[Check].Humanoid.Health > 0 and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then | |
1505 | local ZRay = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
1506 | local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, script.Parent) | |
1507 | if Players[Check]:FindFirstChild("ZFound") ~= nil or (ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check])) then | |
1508 | if ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check]) then | |
1509 | if Players[Check]:FindFirstChild("ZFound") ~= nil then | |
1510 | Players[Check].ZFound:Remove() | |
1511 | end | |
1512 | local ZTag = Instance.new("CFrameValue", Players[Check]) | |
1513 | ZTag.Name = "ZFound" | |
1514 | game:GetService("Debris"):AddItem(ZTag, 5) | |
1515 | end | |
1516 | if (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
1517 | Target = Players[Check].Torso | |
1518 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
1519 | end | |
1520 | end | |
1521 | end | |
1522 | end | |
1523 | if Target == nil then | |
1524 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
1525 | if math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
1526 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
1527 | end | |
1528 | else | |
1529 | Jump() | |
1530 | end | |
1531 | elseif script.Parent.Wander.Value == true then | |
1532 | script.Parent.Humanoid:MoveTo(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target) | |
1533 | end | |
1534 | wait(0.8) | |
1535 | end | |
1536 | end | |
1537 | end) | |
1538 | Delay(0, function() --Random Tool Usage Script | |
1539 | while true do | |
1540 | wait(math.random(40, 70 + math.random(30, 120)) / 10) | |
1541 | local Weapon = nil | |
1542 | local ToolCheck = script.Parent:GetChildren() | |
1543 | for Check = 1, #ToolCheck do | |
1544 | if ToolCheck[Check].ClassName == "Tool" then | |
1545 | Weapon = ToolCheck[Check] | |
1546 | end | |
1547 | end | |
1548 | if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then | |
1549 | if Weapon.Type.Value == "HealDrink" then | |
1550 | Weapon.Active.Value = true | |
1551 | end | |
1552 | end | |
1553 | end | |
1554 | end) | |
1555 | Delay(1, function() --Player Customization Script | |
1556 | if script.Parent["Custom_Name"].Value == "" then | |
1557 | script.Parent.Name = "Player" ..math.random(1, 999) | |
1558 | else | |
1559 | script.Parent.Name = script.Parent["Custom_Name"].Value | |
1560 | end | |
1561 | BColors = {3, 5, 12, 18, 108, 128, 138, 224, 224, 226, 226} | |
1562 | SColors = {145, 146, 147, 148, 149, 150, 168, 176, 178, 179, 200} | |
1563 | PColors = {190, 191, 193, 1024, 1025, 1026, 1027, 1028, 1029, 1030} | |
1564 | BColor = BrickColor.new(BColors[math.random(1, #BColors)]) | |
1565 | SColor = BrickColor.new(SColors[math.random(1, #SColors)]) | |
1566 | PColor = BrickColor.new(PColors[math.random(1, #PColors)]) | |
1567 | if script.Parent.IsOnTeam.Value == true then | |
1568 | SColor = script.Parent.IsOnTeam.Team.Value | |
1569 | PColor = SColor | |
1570 | if script.Parent.IsOnTeam.ShowTag.Value == true then | |
1571 | script.Parent.Name = script.Parent.Name .." [" ..script.Parent.IsOnTeam.Team.Value.Name .."]" | |
1572 | end | |
1573 | end | |
1574 | if script.Parent["Body Colors"].ForceColors.Value ~= true then | |
1575 | script.Parent["Body Colors"].HeadColor = BColor | |
1576 | script.Parent["Body Colors"].LeftArmColor = BColor | |
1577 | script.Parent["Body Colors"].LeftLegColor = PColor | |
1578 | script.Parent["Body Colors"].RightArmColor = BColor | |
1579 | script.Parent["Body Colors"].RightLegColor = PColor | |
1580 | script.Parent["Body Colors"].TorsoColor = SColor | |
1581 | end | |
1582 | script.Parent.Head.BrickColor = script.Parent["Body Colors"].HeadColor | |
1583 | script.Parent["Left Arm"].BrickColor = script.Parent["Body Colors"].LeftArmColor | |
1584 | script.Parent["Left Leg"].BrickColor = script.Parent["Body Colors"].LeftLegColor | |
1585 | script.Parent["Right Arm"].BrickColor = script.Parent["Body Colors"].RightArmColor | |
1586 | script.Parent["Right Leg"].BrickColor = script.Parent["Body Colors"].RightLegColor | |
1587 | script.Parent.Torso.BrickColor = script.Parent["Body Colors"].TorsoColor | |
1588 | if script.Parent["Force_Weapon"].Value ~= 0 then | |
1589 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Weapon"].Value) | |
1590 | local c = x:GetChildren() | |
1591 | for i = 1, #c do | |
1592 | if c[i].ClassName == "Tool" and c[i]:FindFirstChild("AIProgram") ~= nil and c[i]:FindFirstChild("Active") ~= nil and c[i]:FindFirstChild("TargetPos") ~= nil and c[i]:FindFirstChild("Type") ~= nil and c[i]:FindFirstChild("Handle") ~= nil then | |
1593 | c[i].Parent = script.Parent | |
1594 | script.Parent.DropWeapon.Value = false | |
1595 | end | |
1596 | end | |
1597 | end | |
1598 | if script.Parent["Force_Hat"].Value ~= 0 then | |
1599 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Hat"].Value) | |
1600 | local c = x:GetChildren() | |
1601 | for i = 1, #c do | |
1602 | if c[i].ClassName == "Hat" and c[i]:FindFirstChild("Handle") ~= nil then | |
1603 | c[i].Parent = script.Parent | |
1604 | end | |
1605 | end | |
1606 | end | |
1607 | if script.Parent["Force_Shirt"].Value ~= 0 then | |
1608 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Shirt"].Value) | |
1609 | local c = x:GetChildren() | |
1610 | for i = 1, #c do | |
1611 | if c[i].ClassName == "Shirt" then | |
1612 | c[i].Parent = script.Parent | |
1613 | end | |
1614 | end | |
1615 | end | |
1616 | if script.Parent["Force_Pants"].Value ~= 0 then | |
1617 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Pants"].Value) | |
1618 | local c = x:GetChildren() | |
1619 | for i = 1, #c do | |
1620 | if c[i].ClassName == "Pants" then | |
1621 | c[i].Parent = script.Parent | |
1622 | end | |
1623 | end | |
1624 | end | |
1625 | end) | |
1626 | wait() | |
1627 | print("Player Bot Loaded") | |
1628 | end)) | |
1629 | Model0.Name=targetPart.Parent.Name | |
1630 | Model0.Torso.Touched:connect(function(h) | |
1631 | if h.Parent.Name==Model0.Name then | |
1632 | h.Parent:BreakJoints() | |
1633 | Model0:remove() | |
1634 | end | |
1635 | end) | |
1636 | Model0.Torso.Position=Character.Torso.Position | |
1637 | for i,v in pairs(mas:GetChildren()) do | |
1638 | v.Parent = game:GetService("Players").LocalPlayer.Character | |
1639 | pcall(function() v:MakeJoints() end) | |
1640 | end | |
1641 | mas:Destroy() | |
1642 | for i,v in pairs(cors) do | |
1643 | spawn(function() | |
1644 | pcall(v) | |
1645 | end) | |
1646 | end | |
1647 | end | |
1648 | ||
1649 | function yclone() | |
1650 | ||
1651 | --Converted with ttyyuu12345's model to script plugin v4 | |
1652 | function sandbox(var,func) | |
1653 | local env = getfenv(func) | |
1654 | local newenv = setmetatable({},{ | |
1655 | __index = function(self,k) | |
1656 | if k=="script" then | |
1657 | return var | |
1658 | else | |
1659 | return env[k] | |
1660 | end | |
1661 | end, | |
1662 | }) | |
1663 | setfenv(func,newenv) | |
1664 | return func | |
1665 | end | |
1666 | cors = {} | |
1667 | mas = Instance.new("Model",game:GetService("Lighting")) | |
1668 | Model0 = Instance.new("Model") | |
1669 | Model0.Name =Player.Name .."'s clone" | |
1670 | Part1 = Instance.new("Part") | |
1671 | SpecialMesh2 = Instance.new("SpecialMesh") | |
1672 | Decal3 = Instance.new("Decal") | |
1673 | Part4 = Instance.new("Part") | |
1674 | Decal5 = Instance.new("Decal") | |
1675 | Motor6 = Instance.new("Motor") | |
1676 | Motor7 = Instance.new("Motor") | |
1677 | Motor8 = Instance.new("Motor") | |
1678 | Motor9 = Instance.new("Motor") | |
1679 | Motor10 = Instance.new("Motor") | |
1680 | Part11 = Instance.new("Part") | |
1681 | Part12 = Instance.new("Part") | |
1682 | Part13 = Instance.new("Part") | |
1683 | Part14 = Instance.new("Part") | |
1684 | Humanoid15 = Instance.new("Humanoid") | |
1685 | BodyColors16 = Instance.new("BodyColors") | |
1686 | Script17 = Instance.new("Script") | |
1687 | Model0.Name = "Clone" | |
1688 | Model0.Parent = mas | |
1689 | Model0.PrimaryPart = Part1 | |
1690 | Part1.Name = "Head" | |
1691 | Part1.Parent = Model0 | |
1692 | Part1.BrickColor = BrickColor.new("Bright yellow") | |
1693 | Part1.FormFactor = Enum.FormFactor.Symmetric | |
1694 | Part1.Size = Vector3.new(2, 1, 1) | |
1695 | Part1.CFrame = CFrame.new(6.34995413, 4.50001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
1696 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
1697 | Part1.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
1698 | Part1.Position = Vector3.new(6.34995413, 4.50001717, 23.1599998) | |
1699 | Part1.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
1700 | SpecialMesh2.Parent = Part1 | |
1701 | SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25) | |
1702 | SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25) | |
1703 | Decal3.Name = "face" | |
1704 | Decal3.Parent = Part1 | |
1705 | Decal3.Texture = "rbxasset://textures/face.png" | |
1706 | Part4.Name = "Torso" | |
1707 | Part4.Parent = Model0 | |
1708 | Part4.BrickColor = BrickColor.new("Bright blue") | |
1709 | Part4.FormFactor = Enum.FormFactor.Symmetric | |
1710 | Part4.Size = Vector3.new(2, 2, 1) | |
1711 | Part4.CFrame = CFrame.new(6.34995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
1712 | Part4.LeftSurface = Enum.SurfaceType.Weld | |
1713 | Part4.RightSurface = Enum.SurfaceType.Weld | |
1714 | Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451) | |
1715 | Part4.Position = Vector3.new(6.34995413, 3.00001717, 23.1599998) | |
1716 | Part4.Color = Color3.new(0.0509804, 0.411765, 0.67451) | |
1717 | Decal5.Name = "roblox" | |
1718 | Decal5.Parent = Part4 | |
1719 | Motor6.Name = "Right Shoulder" | |
1720 | Motor6.Parent = Part4 | |
1721 | Motor6.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
1722 | Motor6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
1723 | Motor6.Part0 = Part4 | |
1724 | Motor6.Part1 = Part12 | |
1725 | Motor6.MaxVelocity = 0.15000000596046 | |
1726 | Motor7.Name = "Left Shoulder" | |
1727 | Motor7.Parent = Part4 | |
1728 | Motor7.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1729 | Motor7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1730 | Motor7.Part0 = Part4 | |
1731 | Motor7.Part1 = Part11 | |
1732 | Motor7.MaxVelocity = 0.15000000596046 | |
1733 | Motor8.Name = "Right Hip" | |
1734 | Motor8.Parent = Part4 | |
1735 | Motor8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
1736 | Motor8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) | |
1737 | Motor8.Part0 = Part4 | |
1738 | Motor8.Part1 = Part14 | |
1739 | Motor8.MaxVelocity = 0.10000000149012 | |
1740 | Motor9.Name = "Left Hip" | |
1741 | Motor9.Parent = Part4 | |
1742 | Motor9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1743 | Motor9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1744 | Motor9.Part0 = Part4 | |
1745 | Motor9.Part1 = Part13 | |
1746 | Motor9.MaxVelocity = 0.10000000149012 | |
1747 | Motor10.Name = "Neck" | |
1748 | Motor10.Parent = Part4 | |
1749 | Motor10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0) | |
1750 | Motor10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0) | |
1751 | Motor10.Part0 = Part4 | |
1752 | Motor10.Part1 = Part1 | |
1753 | Motor10.MaxVelocity = 0.10000000149012 | |
1754 | Part11.Name = "Left Arm" | |
1755 | Part11.Parent = Model0 | |
1756 | Part11.BrickColor = BrickColor.new("Bright yellow") | |
1757 | Part11.CanCollide = false | |
1758 | Part11.FormFactor = Enum.FormFactor.Symmetric | |
1759 | Part11.Size = Vector3.new(1, 2, 1) | |
1760 | Part11.CFrame = CFrame.new(4.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
1761 | Part11.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
1762 | Part11.Position = Vector3.new(4.84995413, 3.00001717, 23.1599998) | |
1763 | Part11.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
1764 | Part12.Name = "Right Arm" | |
1765 | Part12.Parent = Model0 | |
1766 | Part12.BrickColor = BrickColor.new("Bright yellow") | |
1767 | Part12.CanCollide = false | |
1768 | Part12.FormFactor = Enum.FormFactor.Symmetric | |
1769 | Part12.Size = Vector3.new(1, 2, 1) | |
1770 | Part12.CFrame = CFrame.new(7.84995413, 3.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
1771 | Part12.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
1772 | Part12.Position = Vector3.new(7.84995413, 3.00001717, 23.1599998) | |
1773 | Part12.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
1774 | Part13.Name = "Left Leg" | |
1775 | Part13.Parent = Model0 | |
1776 | Part13.BrickColor = BrickColor.new("Br. yellowish green") | |
1777 | Part13.CanCollide = false | |
1778 | Part13.FormFactor = Enum.FormFactor.Symmetric | |
1779 | Part13.Size = Vector3.new(1, 2, 1) | |
1780 | Part13.CFrame = CFrame.new(5.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
1781 | Part13.BottomSurface = Enum.SurfaceType.Smooth | |
1782 | Part13.TopSurface = Enum.SurfaceType.Inlet | |
1783 | Part13.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
1784 | Part13.Position = Vector3.new(5.84995413, 1.00001717, 23.1599998) | |
1785 | Part13.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
1786 | Part14.Name = "Right Leg" | |
1787 | Part14.Parent = Model0 | |
1788 | Part14.BrickColor = BrickColor.new("Br. yellowish green") | |
1789 | Part14.CanCollide = false | |
1790 | Part14.FormFactor = Enum.FormFactor.Symmetric | |
1791 | Part14.Size = Vector3.new(1, 2, 1) | |
1792 | Part14.CFrame = CFrame.new(6.84995413, 1.00001717, 23.1599998, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
1793 | Part14.BottomSurface = Enum.SurfaceType.Smooth | |
1794 | Part14.TopSurface = Enum.SurfaceType.Inlet | |
1795 | Part14.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
1796 | Part14.Position = Vector3.new(6.84995413, 1.00001717, 23.1599998) | |
1797 | Part14.Color = Color3.new(0.643137, 0.741176, 0.278431) | |
1798 | Humanoid15.Parent = Model0 | |
1799 | Humanoid15.NameOcclusion = Enum.NameOcclusion.NoOcclusion | |
1800 | Humanoid15.RightLeg = Part14 | |
1801 | Humanoid15.LeftLeg = Part13 | |
1802 | Humanoid15.Torso = Part4 | |
1803 | BodyColors16.Parent = Model0 | |
1804 | BodyColors16.HeadColor = BrickColor.new("Bright yellow") | |
1805 | BodyColors16.LeftArmColor = BrickColor.new("Bright yellow") | |
1806 | BodyColors16.LeftLegColor = BrickColor.new("Br. yellowish green") | |
1807 | BodyColors16.RightArmColor = BrickColor.new("Bright yellow") | |
1808 | BodyColors16.RightLegColor = BrickColor.new("Br. yellowish green") | |
1809 | BodyColors16.TorsoColor = BrickColor.new("Bright blue") | |
1810 | Script17.Name = "Full Animation" | |
1811 | Script17.Parent = Model0 | |
1812 | table.insert(cors,sandbox(Script17,function() | |
1813 | --[[Made by Jammer622 @[http://www.roblox.com/Advanced-Player-AI-item?id=59391730], | |
1814 | This is the ORIGINAL model, if you see others, they are stolen. | |
1815 | Scripts mixed from vanilla Animate, Health, and Sound, | |
1816 | with much custom content by myself, making them great AIs. | |
1817 | No help from Miked's scripts, I made my own joint script. | |
1818 | If you find any glitches, bugs, or just want to suggest an idea, please message me. | |
1819 | My team works hard on these AIs, please don't make attempts to steal them. | |
1820 | Your feedback is extremely appreciated! | |
1821 | ||
1822 | _---=CREDITS=---_ | |
1823 | The Roblox Team Without them, none of this would be possible. | |
1824 | Vanilla Sound | |
1825 | Vanilla Health | |
1826 | Vanilla Animate | |
1827 | Jammer622 That's me, main programmer and weapon publisher. | |
1828 | Main Developer | |
1829 | Health GUI Script | |
1830 | Animation Work | |
1831 | Relationship Work | |
1832 | Wandering | |
1833 | Pathing (Map Generation) | |
1834 | Weapon Usage | |
1835 | Weapon (Re)Publishing | |
1836 | Sonypony458 | |
1837 | McDonalds Drink | |
1838 | Customization | |
1839 | Teamwork AI | |
1840 | Model Variables | |
1841 | Setting Wiki [Below] | |
1842 | Macdeath I owe it to him for keeping me on track during this. | |
1843 | Feature Inspiration | |
1844 | Problem Solving | |
1845 | Suggestions | |
1846 | lah30303 Amazing pathing work goes to this fine sir. | |
1847 | Pathing (Pathing Generation/System) | |
1848 | ||
1849 | _---=SETTINGS=---_ | |
1850 | Inside this model's file, you'll find several values that can be changed. | |
1851 | DropWeapon -This sets whether or not the bot will drop any equipped weapon upon dying. | |
1852 | Force_Pants -This must be set through Spawners. | |
1853 | Force_Shirt -This must be set through Spawners. | |
1854 | Force_Weapon -This must be set through Spawners. | |
1855 | Force_Hat -This must be set through Spawners. | |
1856 | IgnoreCombatFF -This sets whether or not the bot will allow friendly fire during combat. | |
1857 | IsAPlayer -This is a tag to specify this bot's existance to other AIs. | |
1858 | IsOnTeam -This sets whether or not the bot is on a team. | |
1859 | ShowTag -This sets whether or not the bot's team color name shows up beside its own. | |
1860 | Team -This sets the bot's team color. | |
1861 | PathTo -This is an experimental pathfinding engine. Use at your own risk! | |
1862 | PrintMap -This prints maps generated when using PathTo. Use at your own risk! | |
1863 | Respawn -This sets whether the bot will respawn or not upon death. | |
1864 | Custom_Name -This must be set through Spawners. | |
1865 | Wander -This sets whether the bot is stationary or if it moves, but not if it uses weapons or not. | |
1866 | ]] | |
1867 | print("Player Bot Loading") | |
1868 | Delay(0, function() --Vanilla Sound | |
1869 | function waitForChild(parent, childName) | |
1870 | local child = parent:findFirstChild(childName) | |
1871 | if child then return child end | |
1872 | while true do | |
1873 | child = parent.ChildAdded:wait() | |
1874 | if child.Name==childName then return child end | |
1875 | end | |
1876 | end | |
1877 | function newSound(id) | |
1878 | local sound = Instance.new("Sound") | |
1879 | sound.SoundId = id | |
1880 | sound.archivable = false | |
1881 | sound.Parent = script.Parent.Head | |
1882 | return sound | |
1883 | end | |
1884 | local sDied = newSound("rbxasset://sounds/uuhhh.wav") | |
1885 | local sFallingDown = newSound("rbxasset://sounds/splat.wav") | |
1886 | local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav") | |
1887 | local sGettingUp = newSound("rbxasset://sounds/hit.wav") | |
1888 | local sJumping = newSound("rbxasset://sounds/button.wav") | |
1889 | local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3") | |
1890 | sRunning.Looped = true | |
1891 | local Figure = script.Parent | |
1892 | local Head = waitForChild(Figure, "Head") | |
1893 | local Humanoid = waitForChild(Figure, "Humanoid") | |
1894 | function onDied() | |
1895 | sDied:Play() | |
1896 | end | |
1897 | function onState(state, sound) | |
1898 | if state then | |
1899 | sound:Play() | |
1900 | else | |
1901 | sound:Pause() | |
1902 | end | |
1903 | end | |
1904 | function onRunning(speed) | |
1905 | if speed>0 then | |
1906 | sRunning:Play() | |
1907 | else | |
1908 | sRunning:Pause() | |
1909 | end | |
1910 | end | |
1911 | ||
1912 | Humanoid.Died:connect(onDied) | |
1913 | Humanoid.Running:connect(onRunning) | |
1914 | Humanoid.Jumping:connect(function(state) onState(state, sJumping) end) | |
1915 | Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end) | |
1916 | Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end) | |
1917 | Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end) | |
1918 | end) | |
1919 | Delay(0, function() --Vanilla Health | |
1920 | function waitForChild(parent, childName) | |
1921 | local child = parent:findFirstChild(childName) | |
1922 | if child then return child end | |
1923 | while true do | |
1924 | child = parent.ChildAdded:wait() | |
1925 | if child.Name==childName then return child end | |
1926 | end | |
1927 | end | |
1928 | local Figure = script.Parent | |
1929 | local Humanoid = waitForChild(Figure, "Humanoid") | |
1930 | local regening = false | |
1931 | function regenHealth() | |
1932 | if regening then return end | |
1933 | regening = true | |
1934 | while Humanoid.Health < Humanoid.MaxHealth do | |
1935 | local s = wait(1) | |
1936 | local health = Humanoid.Health | |
1937 | if health > 0 and health < Humanoid.MaxHealth then | |
1938 | local newHealthDelta = 0.01 * s * Humanoid.MaxHealth | |
1939 | health = health + newHealthDelta | |
1940 | Humanoid.Health = math.min(health,Humanoid.MaxHealth) | |
1941 | end | |
1942 | end | |
1943 | if Humanoid.Health > Humanoid.MaxHealth then | |
1944 | Humanoid.Health = Humanoid.MaxHealth | |
1945 | end | |
1946 | regening = false | |
1947 | end | |
1948 | Humanoid.HealthChanged:connect(regenHealth) | |
1949 | end) | |
1950 | Delay(0, function() --Vanilla Animate, Multiple Additions | |
1951 | function waitForChild(parent, childName) | |
1952 | local child = parent:findFirstChild(childName) | |
1953 | if child then return child end | |
1954 | while true do | |
1955 | child = parent.ChildAdded:wait() | |
1956 | if child.Name==childName then return child end | |
1957 | end | |
1958 | end | |
1959 | local Figure = script.Parent | |
1960 | local Clone = Figure:Clone() | |
1961 | local Torso = waitForChild(Figure, "Torso") | |
1962 | local Joints = Torso:GetChildren() | |
1963 | for All = 1, #Joints do | |
1964 | if Joints.className == "Motor" or Joints.className == "Motor6D" then | |
1965 | Joints[All]:Remove() | |
1966 | end | |
1967 | end | |
1968 | local RightShoulder = Instance.new("Motor") | |
1969 | local LeftShoulder = Instance.new("Motor") | |
1970 | local RightHip = Instance.new("Motor") | |
1971 | local LeftHip = Instance.new("Motor") | |
1972 | local Neck = Instance.new("Motor") | |
1973 | local Humanoid = waitForChild(Figure, "Humanoid") | |
1974 | ZStat = 1 | |
1975 | ZStat2 = 0 | |
1976 | local pose = "Standing" | |
1977 | RightShoulder.Part0 = Torso | |
1978 | RightShoulder.Part1 = Figure["Right Arm"] | |
1979 | RightShoulder.MaxVelocity = 0.15 | |
1980 | RightShoulder.Name = "Right Shoulder" | |
1981 | RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1982 | RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1983 | RightShoulder.Parent = Torso | |
1984 | LeftShoulder.Part0 = Torso | |
1985 | LeftShoulder.Part1 = Figure["Left Arm"] | |
1986 | LeftShoulder.MaxVelocity = 0.15 | |
1987 | LeftShoulder.Name = "Left Shoulder" | |
1988 | LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1989 | LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1990 | LeftShoulder.Parent = Torso | |
1991 | RightHip.Part0 = Torso | |
1992 | RightHip.Part1 = Figure["Right Leg"] | |
1993 | RightHip.MaxVelocity = 0.1 | |
1994 | RightHip.Name = "Right Hip" | |
1995 | RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1996 | RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1997 | RightHip.Parent = Torso | |
1998 | LeftHip.Part0 = Torso | |
1999 | LeftHip.Part1 = Figure["Left Leg"] | |
2000 | LeftHip.MaxVelocity = 0.1 | |
2001 | LeftHip.Name = "Left Hip" | |
2002 | LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
2003 | LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
2004 | LeftHip.Parent = Torso | |
2005 | Neck.Part0 = Torso | |
2006 | Neck.Part1 = Figure["Head"] | |
2007 | Neck.MaxVelocity = 0.1 | |
2008 | Neck.Name = "Neck" | |
2009 | Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
2010 | Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
2011 | Neck.Parent = Torso | |
2012 | local toolAnim = "None" | |
2013 | local toolAnimTime = 0 | |
2014 | SpawnModel = Instance.new("Model") | |
2015 | function onRunning(speed) | |
2016 | if speed>0 then | |
2017 | pose = "Running" | |
2018 | else | |
2019 | pose = "Standing" | |
2020 | end | |
2021 | end | |
2022 | function CheckTag(Tag) | |
2023 | if script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then | |
2024 | if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then | |
2025 | if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == Tag.Value.TeamColor) or script.Parent.IsOnTeam.Value == false then | |
2026 | local Tag2 = Instance.new("CFrameValue", Tag.Value.Character) | |
2027 | Tag2.Name = "IsLocalEnemy" | |
2028 | print(Tag.Value.Character.Name .." Has Become An Outlaw") | |
2029 | end | |
2030 | end | |
2031 | if Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
2032 | Tag.Value.Character:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
2033 | end | |
2034 | local Found = Instance.new("CFrameValue", Tag.Value.Character) | |
2035 | Found.Name = "Loc" ..script.Parent.Name | |
2036 | game:GetService("Debris"):AddItem(Found, 3) | |
2037 | elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Players:FindFirstChild(Tag.Value) ~= nil and game.Players[Tag.Value].Character ~= nil then | |
2038 | if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then | |
2039 | if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and script.Parent.IsOnTeam.Team.Value == game.Players[Tag.Value].TeamColor) or script.Parent.IsOnTeam.Value == false then | |
2040 | local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character) | |
2041 | Tag2.Name = "IsLocalEnemy" | |
2042 | print(Tag.Value .." Has Become An Outlaw") | |
2043 | end | |
2044 | end | |
2045 | if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
2046 | game.Players[Tag.Value].Character:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
2047 | end | |
2048 | local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character) | |
2049 | Found.Name = "Loc" ..script.Parent.Name | |
2050 | game:GetService("Debris"):AddItem(Found, 3) | |
2051 | elseif script.Parent:FindFirstChild("IsLocalEnemy") == nil and script.Parent:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then | |
2052 | if game.Workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then | |
2053 | if (script.Parent.IsOnTeam.Value == true and IsInCombat == false and Workspace[Tag.Value].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value == Workspace[Tag.Value].IsOnTeam.Team.Value) or script.Parent.IsOnTeam.Value == false or Workspace[Tag.Value].IsOnTeam.Value == false then | |
2054 | local Tag2 = Instance.new("CFrameValue", game.Workspace[Tag.Value]) | |
2055 | Tag2.Name = "IsLocalEnemy" | |
2056 | print(Tag.Value .." Has Become An Outlaw") | |
2057 | end | |
2058 | end | |
2059 | if game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
2060 | game.Workspace[Tag.Value]:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
2061 | end | |
2062 | local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value]) | |
2063 | Found.Name = "Loc" ..script.Parent.Name | |
2064 | game:GetService("Debris"):AddItem(Found, 3) | |
2065 | elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then | |
2066 | local Found = Instance.new("CFrameValue", Tag.Value.Character) | |
2067 | Found.Name = "Loc" ..script.Parent.Name | |
2068 | game:GetService("Debris"):AddItem(Found, 3) | |
2069 | elseif (script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then | |
2070 | local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value]) | |
2071 | Found.Name = "Loc" ..script.Parent.Name | |
2072 | game:GetService("Debris"):AddItem(Found, 3) | |
2073 | end | |
2074 | end | |
2075 | function CheckSpawns(Object) | |
2076 | local Parts = Object:GetChildren() | |
2077 | for Check = 1, #Parts do | |
2078 | if Parts[Check].className == "SpawnLocation" then | |
2079 | local I = Instance.new("Vector3Value", SpawnModel) | |
2080 | I.Value = Parts[Check].Position | |
2081 | end | |
2082 | CheckSpawns(Parts[Check]) | |
2083 | end | |
2084 | end | |
2085 | function onDied() | |
2086 | pose = "Dead" | |
2087 | Delay(5, function() | |
2088 | if script.Parent.Respawn.Value == true then | |
2089 | CheckSpawns(Workspace) | |
2090 | local Spawn = SpawnModel:GetChildren() | |
2091 | Clone.Parent = game.Workspace | |
2092 | if #Spawn > 0 then | |
2093 | Spawn = Spawn[math.random(1, #Spawn)].Value | |
2094 | Clone:MoveTo(Spawn) | |
2095 | else | |
2096 | Clone:MoveTo(Vector3.new(0, 50, 0)) | |
2097 | end | |
2098 | end | |
2099 | Figure:Remove() | |
2100 | return | |
2101 | end) | |
2102 | end | |
2103 | function onJumping() | |
2104 | pose = "Jumping" | |
2105 | end | |
2106 | function onClimbing() | |
2107 | pose = "Climbing" | |
2108 | end | |
2109 | function onGettingUp() | |
2110 | pose = "GettingUp" | |
2111 | end | |
2112 | function onFreeFall() | |
2113 | pose = "FreeFall" | |
2114 | end | |
2115 | function onFallingDown() | |
2116 | pose = "FallingDown" | |
2117 | end | |
2118 | function onSeated() | |
2119 | pose = "Seated" | |
2120 | end | |
2121 | function onPlatformStanding() | |
2122 | pose = "PlatformStanding" | |
2123 | end | |
2124 | function moveJump() | |
2125 | RightShoulder.MaxVelocity = 0.5 | |
2126 | LeftShoulder.MaxVelocity = 0.5 | |
2127 | RightShoulder.DesiredAngle = (3.14/ZStat) | |
2128 | LeftShoulder.DesiredAngle = (-3.14/ZStat) | |
2129 | RightHip.DesiredAngle = (0) | |
2130 | LeftHip.DesiredAngle = (0) | |
2131 | end | |
2132 | function moveFreeFall() | |
2133 | RightShoulder.MaxVelocity = 0.5 | |
2134 | LeftShoulder.MaxVelocity = 0.5 | |
2135 | RightShoulder.DesiredAngle = (3.14/ZStat) | |
2136 | LeftShoulder.DesiredAngle = (-3.14/ZStat) | |
2137 | RightHip.DesiredAngle = (0) | |
2138 | LeftHip.DesiredAngle = (0) | |
2139 | end | |
2140 | function moveSit() | |
2141 | RightShoulder.MaxVelocity = 0.15 | |
2142 | LeftShoulder.MaxVelocity = 0.15 | |
2143 | RightShoulder.DesiredAngle = (3.14 /2) | |
2144 | LeftShoulder.DesiredAngle = (-3.14 /2) | |
2145 | RightHip.DesiredAngle = (3.14 /2) | |
2146 | LeftHip.DesiredAngle = (-3.14 /2) | |
2147 | end | |
2148 | function getTool() | |
2149 | for _, kid in ipairs(Figure:GetChildren()) do | |
2150 | if kid.className == "Tool" then return kid end | |
2151 | end | |
2152 | return nil | |
2153 | end | |
2154 | function getToolAnim(tool) | |
2155 | for _, c in ipairs(tool:GetChildren()) do | |
2156 | if c.Name == "toolanim" and c.className == "StringValue" then | |
2157 | return c | |
2158 | end | |
2159 | end | |
2160 | return nil | |
2161 | end | |
2162 | function animateTool() | |
2163 | if (toolAnim == "None") then | |
2164 | RightShoulder.DesiredAngle = (1.57) | |
2165 | return | |
2166 | end | |
2167 | if (toolAnim == "Slash") then | |
2168 | RightShoulder.MaxVelocity = 0.5 | |
2169 | RightShoulder.DesiredAngle = (0) | |
2170 | return | |
2171 | end | |
2172 | if (toolAnim == "Lunge") then | |
2173 | RightShoulder.MaxVelocity = 0.5 | |
2174 | LeftShoulder.MaxVelocity = 0.5 | |
2175 | RightHip.MaxVelocity = 0.5 | |
2176 | LeftHip.MaxVelocity = 0.5 | |
2177 | RightShoulder.DesiredAngle = (1.57) | |
2178 | LeftShoulder.DesiredAngle = (1.0) | |
2179 | RightHip.DesiredAngle = (1.57) | |
2180 | LeftHip.DesiredAngle = (1.0) | |
2181 | return | |
2182 | end | |
2183 | end | |
2184 | function move(time) | |
2185 | local amplitude | |
2186 | local frequency | |
2187 | if (pose == "Jumping") then | |
2188 | moveJump() | |
2189 | return | |
2190 | end | |
2191 | if (pose == "FreeFall") then | |
2192 | moveFreeFall() | |
2193 | return | |
2194 | end | |
2195 | if (pose == "Seated") then | |
2196 | moveSit() | |
2197 | return | |
2198 | end | |
2199 | local climbFudge = 0 | |
2200 | if (pose == "Running") then | |
2201 | RightShoulder.MaxVelocity = 0.15 | |
2202 | LeftShoulder.MaxVelocity = 0.15 | |
2203 | amplitude = 1 | |
2204 | frequency = 9 | |
2205 | elseif (pose == "Climbing") then | |
2206 | RightShoulder.MaxVelocity = 0.5 | |
2207 | LeftShoulder.MaxVelocity = 0.5 | |
2208 | amplitude = 1 | |
2209 | frequency = 9 | |
2210 | climbFudge = 3.14 | |
2211 | else | |
2212 | amplitude = 0.1 | |
2213 | frequency = 1 | |
2214 | end | |
2215 | desiredAngle = amplitude * math.sin(time*frequency) | |
2216 | RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2 | |
2217 | LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2 | |
2218 | RightHip.DesiredAngle = (-desiredAngle) | |
2219 | LeftHip.DesiredAngle = (-desiredAngle) | |
2220 | local tool = getTool() | |
2221 | if tool then | |
2222 | animStringValueObject = getToolAnim(tool) | |
2223 | if animStringValueObject then | |
2224 | toolAnim = animStringValueObject.Value | |
2225 | animStringValueObject.Parent = nil | |
2226 | toolAnimTime = time + .3 | |
2227 | end | |
2228 | if time > toolAnimTime then | |
2229 | toolAnimTime = 0 | |
2230 | toolAnim = "None" | |
2231 | end | |
2232 | animateTool() | |
2233 | else | |
2234 | toolAnim = "None" | |
2235 | toolAnimTime = 0 | |
2236 | end | |
2237 | end | |
2238 | Humanoid.Died:connect(onDied) | |
2239 | Humanoid.Running:connect(onRunning) | |
2240 | Humanoid.Jumping:connect(onJumping) | |
2241 | Humanoid.Climbing:connect(onClimbing) | |
2242 | Humanoid.GettingUp:connect(onGettingUp) | |
2243 | Humanoid.FreeFalling:connect(onFreeFall) | |
2244 | Humanoid.FallingDown:connect(onFallingDown) | |
2245 | Humanoid.Seated:connect(onSeated) | |
2246 | Humanoid.PlatformStanding:connect(onPlatformStanding) | |
2247 | Humanoid.ChildAdded:connect(CheckTag) | |
2248 | OriginalTime = 0.1 | |
2249 | Time = OriginalTime | |
2250 | while Figure.Parent~=nil do | |
2251 | Time = Time + 0.1 | |
2252 | wait(OriginalTime) | |
2253 | move(Time) | |
2254 | end | |
2255 | end) | |
2256 | Delay(0, function() --lah30303's Pathing Script | |
2257 | function CalcMoves(map, px, py, tx, ty) | |
2258 | if map[ty][tx] ~= 0 then | |
2259 | return nil | |
2260 | end | |
2261 | local openlist, closedlist, listk, closedk, tempH, tempG, xsize, ysize, curbase = {}, {}, 1, 0, math.abs(px - tx) + math.abs(py - ty), 0, #map[1], #map, {} | |
2262 | openlist[1] = {x = px, y = py, g = 0, h = tempH, f = 0 + tempH ,par = 1} | |
2263 | local nodenumber = 0 | |
2264 | while listk > 0 do | |
2265 | nodenumber = nodenumber + 1 | |
2266 | if nodenumber / ScanSkip == math.floor(nodenumber / ScanSkip) then | |
2267 | wait() | |
2268 | if DebugPathing == true then | |
2269 | print("Node", nodenumber) | |
2270 | end | |
2271 | end | |
2272 | closedk = closedk + 1 | |
2273 | table.insert(closedlist, closedk, openlist[1]) | |
2274 | curbase = closedlist[closedk] | |
2275 | if closedlist[closedk].x == tx and closedlist[closedk].y == ty then | |
2276 | return closedlist | |
2277 | end | |
2278 | openlist[1] = openlist[listk] | |
2279 | table.remove(openlist, listk) | |
2280 | listk = listk - 1 | |
2281 | local v = 1 | |
2282 | while true do | |
2283 | local u = v | |
2284 | if 2 * u + 1 <= listk then | |
2285 | if openlist[u].f >= openlist[2 * u].f then | |
2286 | v = 2 * u | |
2287 | end | |
2288 | if openlist[v].f >= openlist[2 * u + 1].f then | |
2289 | v = 2 * u + 1 | |
2290 | end | |
2291 | elseif 2 * u <= listk then | |
2292 | if openlist[u].f >= openlist[2 * u].f then | |
2293 | v = 2 * u | |
2294 | end | |
2295 | end | |
2296 | if u ~= v then | |
2297 | local temp = openlist[u] | |
2298 | openlist[u] = openlist[v] | |
2299 | openlist[v] = temp | |
2300 | else | |
2301 | break | |
2302 | end | |
2303 | end | |
2304 | ||
2305 | local tocheck = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}} --[1]Right, [2]Left, [3]Down, [4]Up, [5]UpLeft, [6]UpRight, [7]DownLeft, [8]DownRight | |
2306 | if closedk > 0 then | |
2307 | for k = 1, closedk do | |
2308 | for i, v in pairs(tocheck) do | |
2309 | if closedlist[k].x == curbase.x + v[1] and closedlist[k].y == curbase.y + v[2] then | |
2310 | tocheck[i] = nil | |
2311 | end | |
2312 | end | |
2313 | end | |
2314 | end | |
2315 | for i, v in pairs(tocheck) do | |
2316 | local a = curbase.x + v[1] | |
2317 | local b = curbase.y + v[2] | |
2318 | if a > xsize or a < 1 or b > ysize or b < 1 then | |
2319 | tocheck[i] = nil | |
2320 | end | |
2321 | end | |
2322 | for i, v in pairs(tocheck) do | |
2323 | local a, b = curbase.x + v[1], curbase.y + v[2] | |
2324 | if a <= xsize and a >= 1 and b <= ysize and b >= 1 and map[b][a] ~= 0 then | |
2325 | tocheck[i] = nil | |
2326 | end | |
2327 | end | |
2328 | tempG = curbase.g + 1 | |
2329 | tempDiagG = curbase.g + 1.4 | |
2330 | for k = 1, listk do | |
2331 | for i, v in pairs(tocheck) do | |
2332 | if openlist[k].x == curbase.x + v[1] and openlist[k].y == curbase.y + 1 and openlist[k].g > tempG then | |
2333 | tempH = math.abs((curbase.x + v[1])-tx) + math.abs((curbase.y + v[1])-ty) | |
2334 | table.insert(openlist, k, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG + tempH, par = closedk}) | |
2335 | local m = k | |
2336 | while m ~= 1 do | |
2337 | if openlist[m].f <= openlist[math.floor(m/2)].f then | |
2338 | temp = openlist[math.floor(m/2)] | |
2339 | openlist[math.floor(m/2)] = openlist[m] | |
2340 | openlist[m] = temp | |
2341 | m = math.floor(m/2) | |
2342 | else | |
2343 | break | |
2344 | end | |
2345 | tocheck[i] = nil | |
2346 | end | |
2347 | end | |
2348 | end | |
2349 | end | |
2350 | for i, v in pairs(tocheck) do | |
2351 | listk = listk + 1 | |
2352 | tempH = math.abs((curbase.x + v[1]) - tx) + math.abs((curbase.y + v[2]) - ty) | |
2353 | table.insert(openlist, listk, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG+tempH, par = closedk}) | |
2354 | m = listk | |
2355 | while m ~= 1 do | |
2356 | if openlist[m].f <= openlist[math.floor(m/2)].f then | |
2357 | temp = openlist[math.floor(m/2)] | |
2358 | openlist[math.floor(m/2)] = openlist[m] | |
2359 | openlist[m] = temp | |
2360 | m = math.floor(m/2) | |
2361 | else | |
2362 | break | |
2363 | end | |
2364 | end | |
2365 | end | |
2366 | end | |
2367 | return nil | |
2368 | end | |
2369 | ||
2370 | ||
2371 | function CalcPath(closedlist) | |
2372 | ||
2373 | if closedlist == nil or table.getn(closedlist) == 1 then | |
2374 | return nil | |
2375 | end | |
2376 | local path = {} | |
2377 | local pathIndex = {} | |
2378 | local last = table.getn(closedlist) | |
2379 | table.insert(pathIndex,1,last) | |
2380 | ||
2381 | local i = 1 | |
2382 | while pathIndex[i] > 1 do | |
2383 | i = i + 1 | |
2384 | table.insert(pathIndex, i, closedlist[pathIndex[i - 1]].par) | |
2385 | end | |
2386 | ||
2387 | for n = table.getn(pathIndex) - 1, 1, -1 do | |
2388 | table.insert(path, {x = closedlist[pathIndex[n]].x, y = closedlist[pathIndex[n]].y}) | |
2389 | end | |
2390 | ||
2391 | closedlist = nil | |
2392 | return path | |
2393 | end | |
2394 | end) | |
2395 | Delay(0, function() --Main Artificial Intelligence Scripting/Path Grid Generator | |
2396 | local Base | |
2397 | if script.Parent:FindFirstChild("BASE") == nil then | |
2398 | Base = Instance.new("Part") | |
2399 | Base.Transparency = 1 | |
2400 | Base.TopSurface = "Smooth" | |
2401 | Base.BottomSurface = "Smooth" | |
2402 | Base.CanCollide = false | |
2403 | Base.Anchored = true | |
2404 | Base.Locked = true | |
2405 | Base.BrickColor = BrickColor.new(0, 0, 0) | |
2406 | Base.Name = "BASE" | |
2407 | Base.CFrame = CFrame.new(Vector3.new(0, 0, 0)) | |
2408 | Base.Parent = script.Parent | |
2409 | else | |
2410 | Base = script.Parent.BASE | |
2411 | Base.CFrame = CFrame.new(Vector3.new(0, 0, 0)) | |
2412 | end | |
2413 | function Jump() | |
2414 | script.Parent.Humanoid.Jump = true | |
2415 | end | |
2416 | function Check(Hit) | |
2417 | if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent.Parent ~= nil then | |
2418 | if Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil then | |
2419 | Jump() | |
2420 | end | |
2421 | end | |
2422 | end | |
2423 | script.Parent.Torso.Touched:connect(Check) | |
2424 | function Prep(Target, Current, Attempts) | |
2425 | if Attempts == nil then | |
2426 | Attempts = 1000 | |
2427 | end | |
2428 | local Hit = false | |
2429 | local Tag = Base:Clone() | |
2430 | Tag.Position = Target | |
2431 | Tag.Parent = script.Parent | |
2432 | local TagRay = Ray.new(Tag.CFrame.p, (CFrame.new(Tag.CFrame.p - Vector3.new(0, 3, 0)).p - Tag.CFrame.p).Unit * 40) | |
2433 | local TRHit, TRPos = game.Workspace:FindPartOnRay(TagRay, script.Parent) | |
2434 | if TRHit ~= nil then | |
2435 | Hit = true | |
2436 | end | |
2437 | if Tag.Parent ~= nil then | |
2438 | Tag:Remove() | |
2439 | end | |
2440 | if Hit == false and Attempts > 0 and script.Parent.Wander.Value == true then | |
2441 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1) | |
2442 | elseif script.Parent.Wander.Value == true then | |
2443 | local TargetRay = Ray.new(script.Parent.Torso.CFrame.p, (CFrame.new(Target).p - script.Parent.Torso.CFrame.p).Unit * ((Target - script.Parent.Torso.Position).Magnitude - 3)) | |
2444 | local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, script.Parent) | |
2445 | local TrueTarget = script.Parent.Torso.Position | |
2446 | if THit ~= nil then | |
2447 | for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - TPos).Magnitude) do | |
2448 | local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (TPos - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3) | |
2449 | local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent) | |
2450 | if TH2 ~= nil and TH2.Name ~= "Lava" then | |
2451 | TrueTarget = TP2 | |
2452 | else | |
2453 | break | |
2454 | end | |
2455 | end | |
2456 | else | |
2457 | for HazardCheck = 1, math.floor((script.Parent.Torso.CFrame.p - Target).Magnitude) do | |
2458 | local TR2 = Ray.new(script.Parent.Torso.CFrame.p + (Target - script.Parent.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - script.Parent.Torso.CFrame.p).Unit * 3) | |
2459 | local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, script.Parent) | |
2460 | if TH2 ~= nil and TH2.Name ~= "Lava" then | |
2461 | TrueTarget = TP2 | |
2462 | else | |
2463 | break | |
2464 | end | |
2465 | end | |
2466 | end | |
2467 | script.Parent.Humanoid:MoveTo(TrueTarget, Current) | |
2468 | end | |
2469 | end | |
2470 | function ZHit(Part) | |
2471 | if script.Parent:FindFirstChild("IsAZombie") ~= nil and script.Parent.Humanoid.Health > 0 and Part ~= nil and Part.Parent ~= nil and Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent:FindFirstChild("IsAZombie") == nil then | |
2472 | Part.Parent.Humanoid:TakeDamage(2) | |
2473 | script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + 1 | |
2474 | script.Parent.Humanoid:TakeDamage(-1) | |
2475 | end | |
2476 | end | |
2477 | script.Parent["Right Arm"].Touched:connect(ZHit) | |
2478 | script.Parent["Left Arm"].Touched:connect(ZHit) | |
2479 | CurrentMap = {} | |
2480 | MapMask = {} | |
2481 | MapVar = {0, 0, 0, 0, 0} | |
2482 | BlockScanned = 0 | |
2483 | ScanSkip = 5 | |
2484 | DebugPathing = true | |
2485 | function GenerateMap(PathPos) | |
2486 | CurrentMap = {} | |
2487 | MapMask = {} | |
2488 | MapVar = {0, 0, 0, 0, 0} | |
2489 | BlockScanned = 0 | |
2490 | MapVariables = ScanParts(Workspace, 1) | |
2491 | for MapX = 1, math.max(-MapVariables[1], MapVariables[2]) * 2 + 1 do | |
2492 | CurrentMap[MapX] = {} | |
2493 | for MapY = 1, math.max(-MapVariables[3], MapVariables[4]) * 2 + 1 do | |
2494 | CurrentMap[MapX][MapY] = 0 | |
2495 | end | |
2496 | end | |
2497 | for MaskX = 1, #CurrentMap do | |
2498 | MapMask[MaskX] = {} | |
2499 | for MaskY = 1, #CurrentMap[MaskX] do | |
2500 | MapMask[MaskX][MaskY] = {MapVariables[1] + MaskX - 0.5, MapVariables[1] + MaskY - 0.5} | |
2501 | end | |
2502 | end | |
2503 | ScanParts(Workspace, 2, MapVariables) | |
2504 | wait(1) | |
2505 | if script.Parent.PrintMap.Value == true then | |
2506 | print("Printing Map...") | |
2507 | for ClearPrint = 1, 250 do | |
2508 | wait() | |
2509 | print() | |
2510 | end | |
2511 | for PrintX = 1, #CurrentMap do | |
2512 | local PrintZ = "" | |
2513 | for PrintY = 1, #CurrentMap[PrintX] do | |
2514 | PrintZ = PrintZ ..CurrentMap[PrintX][PrintY] | |
2515 | end | |
2516 | print(PrintZ) | |
2517 | wait(0.1) | |
2518 | end | |
2519 | end | |
2520 | local MapCoords = {0, 0, 0, 0} | |
2521 | local Distance = math.huge | |
2522 | for MPX = 1, #CurrentMap do | |
2523 | for MPY = 1, #CurrentMap[MPX] do | |
2524 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude < Distance then | |
2525 | MapCoords = {MPX, MPY, 0, 0} | |
2526 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude | |
2527 | end | |
2528 | end | |
2529 | end | |
2530 | local Distance = math.huge | |
2531 | for MPX = 1, #CurrentMap do | |
2532 | for MPY = 1, #CurrentMap[MPX] do | |
2533 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude < Distance then | |
2534 | MapCoords = {MapCoords[1], MapCoords[2], math.min(MPX, #CurrentMap) - 1, math.min(MPY, #CurrentMap[1] - 1)} | |
2535 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(script.Parent.PathTo.Value.X, 0, script.Parent.PathTo.Value.Z)).Magnitude | |
2536 | end | |
2537 | end | |
2538 | end | |
2539 | for i, v in pairs(CalcPath(CalcMoves(CurrentMap, MapCoords[1], MapCoords[2], MapCoords[3], MapCoords[4]))) do | |
2540 | local Timer = 20 | |
2541 | local pX = v["x"] | |
2542 | local pY = v["y"] | |
2543 | local pTo = Vector3.new(MapMask[pX][pY][1], 0, MapMask[pX][pY][2]) | |
2544 | pTo = pTo + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit | |
2545 | while (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do | |
2546 | script.Parent.Humanoid:MoveTo(pTo, Base) | |
2547 | Timer = Timer - 1 | |
2548 | if Timer == 10 then | |
2549 | script.Parent.Humanoid.Jump = true | |
2550 | end | |
2551 | wait(0.1) | |
2552 | end | |
2553 | if Timer == 0 then | |
2554 | if (Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z) - pTo).Magnitude <= 5 then | |
2555 | script.Parent.Torso.CFrame = script.Parent.Torso.CFrame + (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Unit * (pTo - Vector3.new(script.Parent.Torso.Position.X, 0, script.Parent.Torso.Position.Z)).Magnitude | |
2556 | else | |
2557 | break | |
2558 | end | |
2559 | end | |
2560 | end | |
2561 | end | |
2562 | function ScanParts(CurrentModel, CurrentStage, Variables) | |
2563 | local X = CurrentModel:GetChildren() | |
2564 | for I = 1, #X do | |
2565 | if #X[I]:GetChildren() > 0 then | |
2566 | ScanParts(X[I], 1, Variables) | |
2567 | end | |
2568 | if X[I].ClassName == "Part" or X[I].ClassName == "WedgePart" or X[I].ClassName == "CornerWedgePart" or X[I].ClassName == "TrussPart" or X[I].ClassName == "SpawnLocation" or X[I].ClassName == "Seat" or X[I].ClassName == "VehicleSeat" or X[I].ClassName == "SkateboardPlatform" then | |
2569 | BlockScanned = BlockScanned + 1 | |
2570 | if BlockScanned / ScanSkip == math.floor(BlockScanned / ScanSkip) then | |
2571 | wait() | |
2572 | if DebugPathing == true then | |
2573 | print("Block", BlockScanned) | |
2574 | end | |
2575 | end | |
2576 | if CurrentStage == 1 then | |
2577 | MapVar[1] = math.min(math.ceil(X[I].Position.X - X[I].Size.X / 2), MapVar[1]) | |
2578 | MapVar[2] = math.max(math.floor(X[I].Position.X + X[I].Size.X / 2), MapVar[2]) | |
2579 | MapVar[3] = math.min(math.ceil(X[I].Position.Z - X[I].Size.Z / 2), MapVar[3]) | |
2580 | MapVar[4] = math.max(math.floor(X[I].Position.Z + X[I].Size.Z / 2), MapVar[4]) | |
2581 | elseif CurrentStage == 2 and ((X[I].Position.Y + X[I].Size.Y / 2 > script.Parent.Torso.Position.Y + 2 and X[I].Position.Y - X[I].Size.Y / 2 < script.Parent.Torso.Position.Y + 2) or X[I].Position.Y + X[I].Size.Y / 2 < script.Parent.Torso.Position.Y - 8) then | |
2582 | local BlockStart = {X[I].Position.X - X[I].Size.X / 2, X[I].Position.Z - X[I].Size.Z / 2} | |
2583 | local BlockEnd = {X[I].Position.X + X[I].Size.X / 2, X[I].Position.Z + X[I].Size.Z / 2} | |
2584 | local BlockCoords = {0, 0, 0, 0} | |
2585 | local Distance = math.huge | |
2586 | for MPX = 1, #CurrentMap do | |
2587 | for MPY = 1, #CurrentMap[MPX] do | |
2588 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude < Distance then | |
2589 | BlockCoords = {MPX, MPY, 0, 0} | |
2590 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude | |
2591 | end | |
2592 | end | |
2593 | end | |
2594 | local Distance = math.huge | |
2595 | for MPX = 1, #CurrentMap do | |
2596 | for MPY = 1, #CurrentMap[MPX] do | |
2597 | if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude < Distance then | |
2598 | BlockCoords = {BlockCoords[1], BlockCoords[2], MPX, MPY} | |
2599 | Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude | |
2600 | end | |
2601 | end | |
2602 | end | |
2603 | for XGrid = BlockCoords[2], BlockCoords[4] do | |
2604 | for YGrid = BlockCoords[1], BlockCoords[3] do | |
2605 | CurrentMap[XGrid][YGrid] = 1 | |
2606 | end | |
2607 | end | |
2608 | end | |
2609 | end | |
2610 | end | |
2611 | if CurrentStage == 1 then | |
2612 | MapVar[5] = {MapVar[1] + MapVar[2] / 2, MapVar[3] + MapVar[4] / 2} | |
2613 | return MapVar | |
2614 | end | |
2615 | end | |
2616 | IsInCombat = false | |
2617 | while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") == nil do | |
2618 | local Distance = 100 | |
2619 | local Target = nil | |
2620 | IsInCombat = false | |
2621 | local Players = Workspace:GetChildren() | |
2622 | for Check = 1, #Players do | |
2623 | if Players[Check] ~= script.Parent and ((Players[Check]:FindFirstChild("Humanoid") ~= nil and (Players[Check]:FindFirstChild("IsAZombie") ~= nil or Players[Check]:FindFirstChild("IsLocalEnemy") ~= nil or script.Parent:FindFirstChild("IsLocalEnemy") ~= nil or (script.Parent.IsOnTeam.Value == true and Players[Check]:FindFirstChild("IsOnTeam") ~= nil and Players[Check].IsOnTeam.Value == true and script.Parent.IsOnTeam.Team.Value ~= Players[Check].IsOnTeam.Team.Value) or (game.Players:GetPlayerFromCharacter(Players[Check]) ~= nil and script.Parent.IsOnTeam.Value == true and game.Players:GetPlayerFromCharacter(Players[Check]).Neutral == false and game.Players:GetPlayerFromCharacter(Players[Check]).TeamColor ~= script.Parent.IsOnTeam.Team.Value)) and Players[Check].Humanoid.Health > 0) or (Players[Check]:FindFirstChild("Zombie") ~= nil and Players[Check].Zombie.ClassName == "Humanoid" and Players[Check].Zombie.Health > 0)) and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then | |
2624 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
2625 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
2626 | if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then | |
2627 | local TeamTag = nil | |
2628 | local Parts = Players[Check]:GetChildren() | |
2629 | for X = 1, #Parts do | |
2630 | if Parts[X].Name == "TeamLoc" then | |
2631 | if Parts[X].Value == script.Parent.IsOnTeam.Team.Value then | |
2632 | TeamTag = Parts[X] | |
2633 | end | |
2634 | end | |
2635 | end | |
2636 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil or Parts[X] ~= nil or (Players[Check].Torso.Position - (script.Parent.Torso.Position + script.Parent.Torso.CFrame.lookVector * 50)).Magnitude <= 52 then | |
2637 | if script.Parent.IsOnTeam.Value == false then | |
2638 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
2639 | Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
2640 | end | |
2641 | local Found = Instance.new("CFrameValue", Players[Check]) | |
2642 | Found.Name = "Loc" ..script.Parent.Name | |
2643 | game:GetService("Debris"):AddItem(Found, 3) | |
2644 | else | |
2645 | if Parts[X] ~= nil then | |
2646 | Parts[X]:Remove() | |
2647 | end | |
2648 | local Found = Instance.new("BrickColorValue", Players[Check]) | |
2649 | Found.Name = "TeamLoc" | |
2650 | Found.Value = script.Parent.IsOnTeam.Team.Value | |
2651 | game:GetService("Debris"):AddItem(Found, 3) | |
2652 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil then | |
2653 | Players[Check]:FindFirstChild("Loc" ..script.Parent.Name):Remove() | |
2654 | end | |
2655 | local Found = Instance.new("CFrameValue", Players[Check]) | |
2656 | Found.Name = "Loc" ..script.Parent.Name | |
2657 | game:GetService("Debris"):AddItem(Found, 3) | |
2658 | end | |
2659 | end | |
2660 | if Players[Check]:FindFirstChild("Loc" ..script.Parent.Name) ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
2661 | Target = Players[Check].Torso | |
2662 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
2663 | end | |
2664 | end | |
2665 | end | |
2666 | end | |
2667 | if Target == nil then | |
2668 | local HasTool = false | |
2669 | local ToolCheck = script.Parent:GetChildren() | |
2670 | for Check = 1, #ToolCheck do | |
2671 | if ToolCheck[Check].ClassName == "Tool" then | |
2672 | HasTool = true | |
2673 | end | |
2674 | end | |
2675 | if HasTool == false then | |
2676 | Distance = 100 | |
2677 | for Check = 1, #Players do | |
2678 | if Players[Check].ClassName == "Tool" and Players[Check]:FindFirstChild("Handle") ~= nil and Players[Check]:FindFirstChild("Active") ~= nil and Players[Check]:FindFirstChild("TargetPos") ~= nil and Players[Check]:FindFirstChild("Type") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
2679 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
2680 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
2681 | if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then | |
2682 | Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude | |
2683 | Target = Players[Check] | |
2684 | end | |
2685 | end | |
2686 | end | |
2687 | if Target ~= nil and Target.ClassName == "Tool" then | |
2688 | if Distance <= 5 and HasTool == false then | |
2689 | Target.Parent = script.Parent | |
2690 | HasTool = true | |
2691 | else | |
2692 | Prep(Target.Handle.Position, Base) | |
2693 | end | |
2694 | else | |
2695 | for Check = 1, #Players do | |
2696 | if Players[Check].Name == "Crate" and Players[Check]:FindFirstChild("OpenCrate") ~= nil and Players[Check].OpenCrate.Value == false and (Players[Check].Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
2697 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
2698 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
2699 | if Hit ~= nil and Hit == Players[Check] then | |
2700 | Target = Players[Check] | |
2701 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
2702 | end | |
2703 | end | |
2704 | end | |
2705 | if Target ~= nil then | |
2706 | script.Parent.Humanoid:MoveTo(Target.Position, Target) | |
2707 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then | |
2708 | Target.OpenCrate.Value = true | |
2709 | end | |
2710 | else | |
2711 | local HasHat = false | |
2712 | local HatCheck = script.Parent:GetChildren() | |
2713 | for Check = 1, #HatCheck do | |
2714 | if ToolCheck[Check].ClassName == "Hat" then | |
2715 | HasHat = true | |
2716 | end | |
2717 | end | |
2718 | if HasHat == false then | |
2719 | Distance = 100 | |
2720 | for Check = 1, #Players do | |
2721 | if Players[Check].ClassName == "Hat" and Players[Check]:FindFirstChild("Handle") ~= nil and (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
2722 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
2723 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
2724 | if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then | |
2725 | Distance = (Players[Check].Handle.Position - script.Parent.Torso.Position).Magnitude | |
2726 | Target = Players[Check] | |
2727 | end | |
2728 | end | |
2729 | end | |
2730 | if Target ~= nil and Target.ClassName == "Hat" then | |
2731 | if Distance <= 5 and HasHat == false then | |
2732 | Target.Parent = script.Parent | |
2733 | HasHat = true | |
2734 | else | |
2735 | Prep(Target.Handle.Position, Base) | |
2736 | end | |
2737 | else | |
2738 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
2739 | if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then | |
2740 | GenerateMap(script.Parent.PathTo.Value) | |
2741 | script.Parent.PathTo.Value = Vector3.new(0, 0, 0) | |
2742 | elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
2743 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
2744 | end | |
2745 | else | |
2746 | Jump() | |
2747 | end | |
2748 | end | |
2749 | end | |
2750 | end | |
2751 | end | |
2752 | else | |
2753 | if Target == nil then | |
2754 | local Distance = 80 | |
2755 | local Players = Workspace:GetChildren() | |
2756 | for Check = 1, #Players do | |
2757 | if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check] ~= script.Parent and Players[Check]:FindFirstChild("IsLocalEnemy") == nil and Players[Check]:FindFirstChild("Leader") ~= nil and Players[Check].Humanoid.Health > 0 and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
2758 | local Ray = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
2759 | local Hit, Position = game.Workspace:FindPartOnRay(Ray, script.Parent) | |
2760 | if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then | |
2761 | Target = Players[Check].Torso | |
2762 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
2763 | end | |
2764 | end | |
2765 | end | |
2766 | if Target ~= nil then | |
2767 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 10 | |
2768 | Prep(Position, Base) | |
2769 | else | |
2770 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
2771 | if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then | |
2772 | GenerateMap(script.Parent.PathTo.Value) | |
2773 | script.Parent.PathTo.Value = Vector3.new(0, 0, 0) | |
2774 | elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
2775 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
2776 | end | |
2777 | else | |
2778 | Jump() | |
2779 | end | |
2780 | end | |
2781 | else | |
2782 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
2783 | if script.Parent.PathTo.Value ~= Vector3.new(0, 0, 0) then | |
2784 | GenerateMap(script.Parent.PathTo.Value) | |
2785 | script.Parent.PathTo.Value = Vector3.new(0, 0, 0) | |
2786 | elseif math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
2787 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
2788 | end | |
2789 | else | |
2790 | Jump() | |
2791 | end | |
2792 | end | |
2793 | end | |
2794 | else | |
2795 | local Weapon = nil | |
2796 | local ToolCheck = script.Parent:GetChildren() | |
2797 | for Check = 1, #ToolCheck do | |
2798 | if ToolCheck[Check].ClassName == "Tool" then | |
2799 | Weapon = ToolCheck[Check] | |
2800 | end | |
2801 | end | |
2802 | if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then | |
2803 | if Weapon.Type.Value == "Melee" then | |
2804 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
2805 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 10 then | |
2806 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2807 | Weapon.Active.Value = true | |
2808 | end | |
2809 | elseif Weapon.Type.Value == "Melee/Ranged" then | |
2810 | if Distance <= 10 then | |
2811 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
2812 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2813 | Weapon.Active.Value = true | |
2814 | else | |
2815 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Base) | |
2816 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 50 then | |
2817 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2818 | Weapon.Active.Value = true | |
2819 | end | |
2820 | end | |
2821 | elseif Weapon.Type.Value == "Melee/RangedMed" then | |
2822 | if Distance <= 10 then | |
2823 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
2824 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2825 | Weapon.Active.Value = true | |
2826 | else | |
2827 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base) | |
2828 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 40 then | |
2829 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2830 | Weapon.Active.Value = true | |
2831 | end | |
2832 | end | |
2833 | elseif Weapon.Type.Value == "Melee/RangedClose" then | |
2834 | if Distance <= 10 then | |
2835 | Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target) | |
2836 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2837 | Weapon.Active.Value = true | |
2838 | else | |
2839 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Base) | |
2840 | if (Target.Position - script.Parent.Torso.Position).Magnitude <= 30 then | |
2841 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2842 | Weapon.Active.Value = true | |
2843 | end | |
2844 | end | |
2845 | elseif Weapon.Type.Value == "Ranged" then | |
2846 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base) | |
2847 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2848 | wait() | |
2849 | Weapon.Active.Value = true | |
2850 | elseif Weapon.Type.Value == "RangedMed" then | |
2851 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 60, Base) | |
2852 | if Distance <= 70 then | |
2853 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2854 | wait() | |
2855 | Weapon.Active.Value = true | |
2856 | end | |
2857 | elseif Weapon.Type.Value == "RangedClose" then | |
2858 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 30, Base) | |
2859 | if Distance <= 40 then | |
2860 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2861 | wait() | |
2862 | Weapon.Active.Value = true | |
2863 | end | |
2864 | elseif Weapon.Type.Value == "RangedAngle" and Distance <= 100 then | |
2865 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * (script.Parent.Torso.Position - Target.Position).Magnitude + Target.Velocity | |
2866 | script.Parent.Humanoid:MoveTo(Position, Base) | |
2867 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2868 | wait() | |
2869 | Weapon.Active.Value = true | |
2870 | elseif Weapon.Type.Value == "RangedTactical" then | |
2871 | if Distance <= 30 then | |
2872 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 50 | |
2873 | Prep(Position, Base) | |
2874 | elseif Distance >= 50 then | |
2875 | Prep(Target.Position, Target) | |
2876 | end | |
2877 | if Distance <= 50 and Distance >= 30 then | |
2878 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 40, Target.Parent.Torso) | |
2879 | end | |
2880 | if Distance <= 60 then | |
2881 | Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2882 | wait() | |
2883 | Weapon.Active.Value = true | |
2884 | end | |
2885 | elseif Weapon.Type.Value == "Shuriken" then | |
2886 | if Distance <= 15 then | |
2887 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20 | |
2888 | Prep(Position, Base) | |
2889 | elseif Distance >= 30 then | |
2890 | Prep(Target.Position, Target) | |
2891 | end | |
2892 | if Distance <= 30 and Distance >= 15 then | |
2893 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 20, Target.Parent.Torso) | |
2894 | end | |
2895 | if Distance <= 50 then | |
2896 | Weapon.TargetPos.Value = (Target.Position + Target.Velocity / 2) + Vector3.new(math.random(-2, 2), math.random(-2, 2) + ((Target.Position + Target.Velocity / 2) - script.Parent.Torso.Position).Magnitude / 8, math.random(-2, 2)) | |
2897 | wait() | |
2898 | Weapon.Active.Value = true | |
2899 | end | |
2900 | elseif Weapon.Type.Value == "HealDrink" then | |
2901 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120 | |
2902 | Prep(Position, Base) | |
2903 | if script.Parent.Humanoid.Health < script.Parent.Humanoid.MaxHealth then | |
2904 | Weapon.Active.Value = true | |
2905 | end | |
2906 | elseif Weapon.Type.Value == "GrenadeDirect" then | |
2907 | if Distance >= 80 and Distance <= 100 then | |
2908 | Prep(Target.Position, Target) | |
2909 | wait(0.5) | |
2910 | Weapon.Active.Value = true | |
2911 | wait(0.5) | |
2912 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100 | |
2913 | Prep(Position, Base) | |
2914 | else | |
2915 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100 | |
2916 | Prep(Position, Base) | |
2917 | end | |
2918 | elseif Weapon.Type.Value == "Bomb" then | |
2919 | if Distance > 10 then | |
2920 | Prep(Target.Position, Target) | |
2921 | elseif Distance <= 10 then | |
2922 | Weapon.Active.Value = true | |
2923 | wait(2) | |
2924 | while Weapon ~= nil and Weapon:FindFirstChild("Handle") ~= nil and Weapon.Handle.Transparency == 1 do | |
2925 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 80, Base) | |
2926 | wait(0.5) | |
2927 | end | |
2928 | end | |
2929 | elseif Weapon.Type.Value == "Backstab" then | |
2930 | if Distance >= 10 then | |
2931 | if (script.Parent.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then | |
2932 | Prep(Target.Position, Target) | |
2933 | else | |
2934 | if (script.Parent.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then | |
2935 | Prep(Target.Position, Base) | |
2936 | local backstab_time = 20 | |
2937 | while backstab_time > 1 and (script.Parent.Torso.Position - Target.Position).Magnitude >= 4 do | |
2938 | wait(0.1) | |
2939 | backstab_time = backstab_time - 1 | |
2940 | end | |
2941 | if (script.Parent.Torso.Position - Target.Position).Magnitude < 4 then | |
2942 | Weapon.Active.Value = true | |
2943 | end | |
2944 | else | |
2945 | Prep(Target.Position - Target.CFrame.lookVector * 15, Base) | |
2946 | end | |
2947 | end | |
2948 | else | |
2949 | Prep(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target) | |
2950 | if Distance <= 5 then | |
2951 | Weapon.Active.Value = true | |
2952 | end | |
2953 | end | |
2954 | elseif Weapon.Type.Value == "Crossbow" then | |
2955 | if Distance > 80 then | |
2956 | Prep(Target.Position, Target) | |
2957 | elseif Distance < 40 then | |
2958 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 100, Base) | |
2959 | elseif Distance <= 80 and Distance >= 40 then | |
2960 | Prep(Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * ((script.Parent.Torso.Position - Target.Position).Magnitude - 5), Base) | |
2961 | wait(0.2) | |
2962 | Weapon.TargetPos.Value = Target.Position + Target.Velocity / 8 + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2)) | |
2963 | Weapon.Active.Value = true | |
2964 | end | |
2965 | end | |
2966 | IsInCombat = true | |
2967 | elseif Distance <= 100 then | |
2968 | local Position = Target.Position + (script.Parent.Torso.Position - Target.Position).Unit * 120 | |
2969 | Prep(Position, Base) | |
2970 | end | |
2971 | end | |
2972 | if IsInCombat == true then | |
2973 | wait(0.2) | |
2974 | else | |
2975 | wait(0.6) | |
2976 | end | |
2977 | end | |
2978 | local Weapon = nil | |
2979 | local ToolCheck = script.Parent:GetChildren() | |
2980 | for Check = 1, #ToolCheck do | |
2981 | if ToolCheck[Check].ClassName == "Tool" then | |
2982 | Weapon = ToolCheck[Check] | |
2983 | end | |
2984 | end | |
2985 | if Weapon ~= nil and script.Parent.DropWeapon.Value == true then | |
2986 | Weapon.Parent = Workspace | |
2987 | elseif Weapon ~= nil then | |
2988 | Weapon:Remove() | |
2989 | end | |
2990 | if script.Parent:FindFirstChild("IsAZombie") ~= nil then | |
2991 | script.Parent.Name = "New Zombie" | |
2992 | script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100))) | |
2993 | wait() | |
2994 | script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth | |
2995 | script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + math.random(math.random(-200, 0), math.random(100, math.random(200, 300))) / 100 | |
2996 | ZStat = 2 | |
2997 | ZStat2 = 1.57 | |
2998 | Delay(1, function() | |
2999 | while script.Parent:FindFirstChild("Humanoid") ~= nil and script.Parent.Humanoid.Health > 0 do | |
3000 | script.Parent.Humanoid.MaxHealth = math.max(0, script.Parent.Humanoid.MaxHealth - 1) | |
3001 | script.Parent.Humanoid.Health = math.min(script.Parent.Humanoid.Health, script.Parent.Humanoid.MaxHealth) | |
3002 | wait(1) | |
3003 | end | |
3004 | end) | |
3005 | while script.Parent.Humanoid.Health > 0 and script.Parent:FindFirstChild("IsAZombie") ~= nil do | |
3006 | local Distance = 100 | |
3007 | local Target = nil | |
3008 | local Players = Workspace:GetChildren() | |
3009 | for Check = 1, #Players do | |
3010 | if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check]:FindFirstChild("Torso") ~= nil and Players[Check]:FindFirstChild("IsAZombie") == nil and Players[Check].Humanoid.Health > 0 and (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= 100 then | |
3011 | local ZRay = Ray.new(script.Parent.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - script.Parent.Torso.CFrame.p).Unit * 100) | |
3012 | local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, script.Parent) | |
3013 | if Players[Check]:FindFirstChild("ZFound") ~= nil or (ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check])) then | |
3014 | if ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check]) then | |
3015 | if Players[Check]:FindFirstChild("ZFound") ~= nil then | |
3016 | Players[Check].ZFound:Remove() | |
3017 | end | |
3018 | local ZTag = Instance.new("CFrameValue", Players[Check]) | |
3019 | ZTag.Name = "ZFound" | |
3020 | game:GetService("Debris"):AddItem(ZTag, 5) | |
3021 | end | |
3022 | if (Players[Check].Torso.Position - script.Parent.Torso.Position).Magnitude <= Distance then | |
3023 | Target = Players[Check].Torso | |
3024 | Distance = (Target.Position - script.Parent.Torso.Position).Magnitude | |
3025 | end | |
3026 | end | |
3027 | end | |
3028 | end | |
3029 | if Target == nil then | |
3030 | if script.Parent.Humanoid.PlatformStand == false and script.Parent.Humanoid.Sit == false then | |
3031 | if math.random(1, 10) == 1 and script.Parent.Wander.Value == true then | |
3032 | Prep(script.Parent.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base) | |
3033 | end | |
3034 | else | |
3035 | Jump() | |
3036 | end | |
3037 | elseif script.Parent.Wander.Value == true then | |
3038 | script.Parent.Humanoid:MoveTo(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target) | |
3039 | end | |
3040 | wait(0.8) | |
3041 | end | |
3042 | end | |
3043 | end) | |
3044 | Delay(0, function() --Random Tool Usage Script | |
3045 | while true do | |
3046 | wait(math.random(40, 70 + math.random(30, 120)) / 10) | |
3047 | local Weapon = nil | |
3048 | local ToolCheck = script.Parent:GetChildren() | |
3049 | for Check = 1, #ToolCheck do | |
3050 | if ToolCheck[Check].ClassName == "Tool" then | |
3051 | Weapon = ToolCheck[Check] | |
3052 | end | |
3053 | end | |
3054 | if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then | |
3055 | if Weapon.Type.Value == "HealDrink" then | |
3056 | Weapon.Active.Value = true | |
3057 | end | |
3058 | end | |
3059 | end | |
3060 | end) | |
3061 | Delay(1, function() --Player Customization Script | |
3062 | if script.Parent["Custom_Name"].Value == "" then | |
3063 | script.Parent.Name = "Player" ..math.random(1, 999) | |
3064 | else | |
3065 | script.Parent.Name = script.Parent["Custom_Name"].Value | |
3066 | end | |
3067 | BColors = {3, 5, 12, 18, 108, 128, 138, 224, 224, 226, 226} | |
3068 | SColors = {145, 146, 147, 148, 149, 150, 168, 176, 178, 179, 200} | |
3069 | PColors = {190, 191, 193, 1024, 1025, 1026, 1027, 1028, 1029, 1030} | |
3070 | BColor = BrickColor.new(BColors[math.random(1, #BColors)]) | |
3071 | SColor = BrickColor.new(SColors[math.random(1, #SColors)]) | |
3072 | PColor = BrickColor.new(PColors[math.random(1, #PColors)]) | |
3073 | if script.Parent.IsOnTeam.Value == true then | |
3074 | SColor = script.Parent.IsOnTeam.Team.Value | |
3075 | PColor = SColor | |
3076 | if script.Parent.IsOnTeam.ShowTag.Value == true then | |
3077 | script.Parent.Name = script.Parent.Name .." [" ..script.Parent.IsOnTeam.Team.Value.Name .."]" | |
3078 | end | |
3079 | end | |
3080 | if script.Parent["Body Colors"].ForceColors.Value ~= true then | |
3081 | script.Parent["Body Colors"].HeadColor = BColor | |
3082 | script.Parent["Body Colors"].LeftArmColor = BColor | |
3083 | script.Parent["Body Colors"].LeftLegColor = PColor | |
3084 | script.Parent["Body Colors"].RightArmColor = BColor | |
3085 | script.Parent["Body Colors"].RightLegColor = PColor | |
3086 | script.Parent["Body Colors"].TorsoColor = SColor | |
3087 | end | |
3088 | script.Parent.Head.BrickColor = script.Parent["Body Colors"].HeadColor | |
3089 | script.Parent["Left Arm"].BrickColor = script.Parent["Body Colors"].LeftArmColor | |
3090 | script.Parent["Left Leg"].BrickColor = script.Parent["Body Colors"].LeftLegColor | |
3091 | script.Parent["Right Arm"].BrickColor = script.Parent["Body Colors"].RightArmColor | |
3092 | script.Parent["Right Leg"].BrickColor = script.Parent["Body Colors"].RightLegColor | |
3093 | script.Parent.Torso.BrickColor = script.Parent["Body Colors"].TorsoColor | |
3094 | if script.Parent["Force_Weapon"].Value ~= 0 then | |
3095 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Weapon"].Value) | |
3096 | local c = x:GetChildren() | |
3097 | for i = 1, #c do | |
3098 | if c[i].ClassName == "Tool" and c[i]:FindFirstChild("AIProgram") ~= nil and c[i]:FindFirstChild("Active") ~= nil and c[i]:FindFirstChild("TargetPos") ~= nil and c[i]:FindFirstChild("Type") ~= nil and c[i]:FindFirstChild("Handle") ~= nil then | |
3099 | c[i].Parent = script.Parent | |
3100 | script.Parent.DropWeapon.Value = false | |
3101 | end | |
3102 | end | |
3103 | end | |
3104 | if script.Parent["Force_Hat"].Value ~= 0 then | |
3105 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Hat"].Value) | |
3106 | local c = x:GetChildren() | |
3107 | for i = 1, #c do | |
3108 | if c[i].ClassName == "Hat" and c[i]:FindFirstChild("Handle") ~= nil then | |
3109 | c[i].Parent = script.Parent | |
3110 | end | |
3111 | end | |
3112 | end | |
3113 | if script.Parent["Force_Shirt"].Value ~= 0 then | |
3114 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Shirt"].Value) | |
3115 | local c = x:GetChildren() | |
3116 | for i = 1, #c do | |
3117 | if c[i].ClassName == "Shirt" then | |
3118 | c[i].Parent = script.Parent | |
3119 | end | |
3120 | end | |
3121 | end | |
3122 | if script.Parent["Force_Pants"].Value ~= 0 then | |
3123 | local x = game:GetService("InsertService"):LoadAsset(script.Parent["Force_Pants"].Value) | |
3124 | local c = x:GetChildren() | |
3125 | for i = 1, #c do | |
3126 | if c[i].ClassName == "Pants" then | |
3127 | c[i].Parent = script.Parent | |
3128 | end | |
3129 | end | |
3130 | end | |
3131 | end) | |
3132 | wait() | |
3133 | print("Player Bot Loaded") | |
3134 | end)) | |
3135 | Model0.Humanoid.Died:connect(function() | |
3136 | Model0:remove() | |
3137 | YOURCLONE=nil | |
3138 | end) | |
3139 | ||
3140 | Model0.Torso.Position=Vector3.new(Character.Torso.Position.X,Character.Torso.Position.Y+3,Character.Torso.Position.Z) | |
3141 | Model0.Name=Character.Name.."'s clone" | |
3142 | Model0.Humanoid.WalkToPart=torso | |
3143 | YOURCLONE=Model0 | |
3144 | for i,v in pairs(mas:GetChildren()) do | |
3145 | v.Parent = workspace | |
3146 | pcall(function() v:MakeJoints() end) | |
3147 | end | |
3148 | mas:Destroy() | |
3149 | for i,v in pairs(cors) do | |
3150 | spawn(function() | |
3151 | pcall(v) | |
3152 | end) | |
3153 | end | |
3154 | end | |
3155 | ||
3156 | --Converted with ttyyuu12345's model to script plugin v4 | |
3157 | function sandbox(var,func) | |
3158 | local env = getfenv(func) | |
3159 | local newenv = setmetatable({},{ | |
3160 | __index = function(self,k) | |
3161 | if k=="script" then | |
3162 | return var | |
3163 | else | |
3164 | return env[k] | |
3165 | end | |
3166 | end, | |
3167 | }) | |
3168 | setfenv(func,newenv) | |
3169 | return func | |
3170 | end | |
3171 | cors = {} | |
3172 | mas = Instance.new("Model",game:GetService("Lighting")) | |
3173 | Model0 = Instance.new("Model") | |
3174 | MEF=Model0 | |
3175 | Part1 = Instance.new("Part") | |
3176 | SpecialMesh2 = Instance.new("SpecialMesh") | |
3177 | Part3 = Instance.new("Part") | |
3178 | SpecialMesh4 = Instance.new("SpecialMesh") | |
3179 | Part5 = Instance.new("Part") | |
3180 | SpecialMesh6 = Instance.new("SpecialMesh") | |
3181 | Part7 = Instance.new("Part") | |
3182 | SpecialMesh8 = Instance.new("SpecialMesh") | |
3183 | Part9 = Instance.new("Part") | |
3184 | SpecialMesh10 = Instance.new("SpecialMesh") | |
3185 | Part11 = Instance.new("Part") | |
3186 | SpecialMesh12 = Instance.new("SpecialMesh") | |
3187 | Model0.Parent = mas | |
3188 | Part1.Name = "Right Arm" | |
3189 | Part1.Parent = Model0 | |
3190 | Part1.Material = Enum.Material.Glass | |
3191 | Part1.BrickColor = BrickColor.new("Pastel blue-green") | |
3192 | Part1.Rotation = Vector3.new(-180, 0, -90) | |
3193 | Part1.Size = Vector3.new(4, 1, 2) | |
3194 | Part1.CFrame = CFrame.new(-12.3300028, 0.500003994, -1.11000025, 0, 1, 0, 1, 0, 0, 0, 0, -1) | |
3195 | Part1.BottomSurface = Enum.SurfaceType.Smooth | |
3196 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
3197 | Part1.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3198 | Part1.Position = Vector3.new(-12.3300028, 0.500003994, -1.11000025) | |
3199 | Part1.Orientation = Vector3.new(0, 180, 90) | |
3200 | Part1.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3201 | SpecialMesh2.Parent = Part1 | |
3202 | SpecialMesh2.MeshId = "rbxassetid://1563415862" | |
3203 | SpecialMesh2.Offset = Vector3.new(0, 4, 0) | |
3204 | SpecialMesh2.MeshType = Enum.MeshType.FileMesh | |
3205 | Part3.Name = "Right Leg" | |
3206 | Part3.Parent = Model0 | |
3207 | Part3.Material = Enum.Material.Glass | |
3208 | Part3.BrickColor = BrickColor.new("Pastel blue-green") | |
3209 | Part3.Rotation = Vector3.new(-180, 0, -90) | |
3210 | Part3.Size = Vector3.new(4, 1, 2) | |
3211 | Part3.CFrame = CFrame.new(-14.3400002, 0.500003994, -0.0500001721, 0, 1, 0, 1, 0, 0, 0, 0, -1) | |
3212 | Part3.BottomSurface = Enum.SurfaceType.Smooth | |
3213 | Part3.TopSurface = Enum.SurfaceType.Smooth | |
3214 | Part3.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3215 | Part3.Position = Vector3.new(-14.3400002, 0.500003994, -0.0500001721) | |
3216 | Part3.Orientation = Vector3.new(0, 180, 90) | |
3217 | Part3.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3218 | SpecialMesh4.Parent = Part3 | |
3219 | SpecialMesh4.MeshId = "rbxassetid://1563410216" | |
3220 | SpecialMesh4.Offset = Vector3.new(0, 4, 0) | |
3221 | SpecialMesh4.MeshType = Enum.MeshType.FileMesh | |
3222 | Part5.Name = "Left Leg" | |
3223 | Part5.Parent = Model0 | |
3224 | Part5.Material = Enum.Material.Glass | |
3225 | Part5.BrickColor = BrickColor.new("Pastel blue-green") | |
3226 | Part5.Rotation = Vector3.new(-180, 0, -90) | |
3227 | Part5.Size = Vector3.new(4, 1, 2) | |
3228 | Part5.CFrame = CFrame.new(-14.3299971, 0.500003994, 1.17999947, 0, 1, 0, 1, 0, 0, 0, 0, -1) | |
3229 | Part5.BottomSurface = Enum.SurfaceType.Smooth | |
3230 | Part5.TopSurface = Enum.SurfaceType.Smooth | |
3231 | Part5.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3232 | Part5.Position = Vector3.new(-14.3299971, 0.500003994, 1.17999947) | |
3233 | Part5.Orientation = Vector3.new(0, 180, 90) | |
3234 | Part5.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3235 | SpecialMesh6.Parent = Part5 | |
3236 | SpecialMesh6.MeshId = "rbxassetid://1563408982" | |
3237 | SpecialMesh6.Offset = Vector3.new(0, 4, 0) | |
3238 | SpecialMesh6.MeshType = Enum.MeshType.FileMesh | |
3239 | Part7.Name = "Left Arm" | |
3240 | Part7.Parent = Model0 | |
3241 | Part7.Material = Enum.Material.Glass | |
3242 | Part7.BrickColor = BrickColor.new("Pastel blue-green") | |
3243 | Part7.Rotation = Vector3.new(0, 0, -90) | |
3244 | Part7.Size = Vector3.new(4, 1, 2) | |
3245 | Part7.CFrame = CFrame.new(-12.2099981, 0.490003794, 2.1400013, 0, 1, 0, -1, 0, 0, 0, 0, 1) | |
3246 | Part7.BottomSurface = Enum.SurfaceType.Smooth | |
3247 | Part7.TopSurface = Enum.SurfaceType.Smooth | |
3248 | Part7.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3249 | Part7.Position = Vector3.new(-12.2099981, 0.490003794, 2.1400013) | |
3250 | Part7.Orientation = Vector3.new(0, 0, -90) | |
3251 | Part7.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3252 | SpecialMesh8.Parent = Part7 | |
3253 | SpecialMesh8.MeshId = "rbxassetid://1563407350" | |
3254 | SpecialMesh8.Offset = Vector3.new(0, 4, 0) | |
3255 | SpecialMesh8.MeshType = Enum.MeshType.FileMesh | |
3256 | Part9.Name = "Torso" | |
3257 | Part9.Parent = Model0 | |
3258 | Part9.Material = Enum.Material.Glass | |
3259 | Part9.BrickColor = BrickColor.new("Pastel blue-green") | |
3260 | Part9.Rotation = Vector3.new(-180, 0, -90) | |
3261 | Part9.Size = Vector3.new(4, 1, 2) | |
3262 | Part9.CFrame = CFrame.new(-12.6299973, 0.500003994, 0.519999921, 0, 1, 0, 1, 0, 0, 0, 0, -1) | |
3263 | Part9.BottomSurface = Enum.SurfaceType.Smooth | |
3264 | Part9.TopSurface = Enum.SurfaceType.Smooth | |
3265 | Part9.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3266 | Part9.Position = Vector3.new(-12.6299973, 0.500003994, 0.519999921) | |
3267 | Part9.Orientation = Vector3.new(0, 180, 90) | |
3268 | Part9.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3269 | SpecialMesh10.Parent = Part9 | |
3270 | SpecialMesh10.MeshId = "rbxassetid://1563386325" | |
3271 | SpecialMesh10.MeshType = Enum.MeshType.FileMesh | |
3272 | Part11.Name = "Head" | |
3273 | Part11.Parent = Model0 | |
3274 | Part11.Material = Enum.Material.Glass | |
3275 | Part11.BrickColor = BrickColor.new("Pastel blue-green") | |
3276 | Part11.Rotation = Vector3.new(-180, 0, -90) | |
3277 | Part11.Size = Vector3.new(4, 1, 2) | |
3278 | Part11.CFrame = CFrame.new(-10.1799965, 0.500003994, 0.519999921, 0, 1, 0, 1, 0, 0, 0, 0, -1) | |
3279 | Part11.BottomSurface = Enum.SurfaceType.Smooth | |
3280 | Part11.TopSurface = Enum.SurfaceType.Smooth | |
3281 | Part11.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3282 | Part11.Position = Vector3.new(-10.1799965, 0.500003994, 0.519999921) | |
3283 | Part11.Orientation = Vector3.new(0, 180, 90) | |
3284 | Part11.Color = Color3.new(0.623529, 0.952941, 0.913726) | |
3285 | SpecialMesh12.Parent = Part11 | |
3286 | SpecialMesh12.MeshId = "rbxassetid://1563390192" | |
3287 | SpecialMesh12.MeshType = Enum.MeshType.FileMesh | |
3288 | for i,v in pairs(mas:GetChildren()) do | |
3289 | v.Parent = AdvancingFortress | |
3290 | pcall(function() v:MakeJoints() end) | |
3291 | end | |
3292 | mas:Destroy() | |
3293 | for i,v in pairs(cors) do | |
3294 | spawn(function() | |
3295 | pcall(v) | |
3296 | end) | |
3297 | end | |
3298 | --end of costume | |
3299 | ||
3300 | ||
3301 | AdvancingFortress.Parent = Character | |
3302 | torso = AdvancingFortress.Torso | |
3303 | hum = AdvancingFortress.Humanoid | |
3304 | AdvancingFortress.Name = "Advancing Fortress" | |
3305 | pl = AdvancingFortress | |
3306 | for i, v in pairs(AdvancingFortress:GetChildren()) do | |
3307 | if v:IsA("BasePart") then | |
3308 | v.Transparency = 1 | |
3309 | end | |
3310 | end | |
3311 | local Humanoid = AdvancingFortress.Humanoid | |
3312 | local Mouse = Player:GetMouse() | |
3313 | local LeftArm = AdvancingFortress["Left Arm"] | |
3314 | local RightArm = AdvancingFortress["Right Arm"] | |
3315 | local LeftLeg = AdvancingFortress["Left Leg"] | |
3316 | local RightLeg = AdvancingFortress["Right Leg"] | |
3317 | local Head = AdvancingFortress.Head | |
3318 | local Torso = AdvancingFortress.Torso | |
3319 | local Camera = game.Workspace.CurrentCamera | |
3320 | local RootPart = AdvancingFortress.HumanoidRootPart | |
3321 | local RootJoint = RootPart.RootJoint | |
3322 | local attack = false | |
3323 | local Anim = "Idle" | |
3324 | local attacktype = 1 | |
3325 | local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
3326 | local velocity = RootPart.Velocity.y | |
3327 | local sine = 0 | |
3328 | local change = 1 | |
3329 | local Create = LoadLibrary("RbxUtility").Create | |
3330 | local TimeStop = false | |
3331 | local m = Create("Model")({ | |
3332 | Parent = AdvancingFortress, | |
3333 | Name = "WeaponModel" | |
3334 | }) | |
3335 | --for _,v in pairs(KQ) do | |
3336 | --v.Transparency=1 | |
3337 | --end | |
3338 | KQ={ | |
3339 | ||
3340 | } | |
3341 | ||
3342 | AdvancingFortress.Head.Name = "FHead" | |
3343 | AdvancingFortress.Torso.Name = "FTorso" | |
3344 | ||
3345 | ||
3346 | shirt = Instance.new("Shirt", Character) | |
3347 | shirt.Name = "Shirt" | |
3348 | pants = Instance.new("Pants", Character) | |
3349 | pants.Name = "Pants" | |
3350 | Character.Shirt.ShirtTemplate = "rbxassetid://609199174" | |
3351 | Character.Pants.PantsTemplate = "rbxassetid://1079566963" | |
3352 | ||
3353 | for i, v in pairs(Character:GetChildren()) do | |
3354 | if v.ClassName == "Accessory" then | |
3355 | v:Remove() | |
3356 | end | |
3357 | end | |
3358 | ||
3359 | Hat3 = Instance.new("Model") | |
3360 | Hat3.Parent = Character | |
3361 | Hat3.Name = "Hat3" | |
3362 | rh = Instance.new("Part") | |
3363 | rh.Parent = Hat3 | |
3364 | rh.BrickColor = BrickColor.new("Cool yellow") | |
3365 | rh.Locked = true | |
3366 | rh.CanCollide = false | |
3367 | mesh = Instance.new("SpecialMesh") | |
3368 | rh.formFactor = "Symmetric" | |
3369 | mesh.MeshType = "FileMesh" | |
3370 | mesh.MeshId = "rbxassetid://495152230" | |
3371 | mesh.Parent = rh | |
3372 | local weld = Instance.new("Weld") | |
3373 | weld.Parent = rh | |
3374 | weld.Part0 = rh | |
3375 | weld.Part1 =Character.Head | |
3376 | weld.C0 = CFrame.new(0, 0.4, 0)*CFrame.Angles(0, 0, 0) | |
3377 | mesh.Scale = Vector3.new(1,1,1) | |
3378 | Hat3.Part.Transparency = 0 | |
3379 | ||
3380 | for _,v in pairs(AdvancingFortress:GetChildren()) do | |
3381 | if v:IsA('Part') then | |
3382 | v.BrickColor=BrickColor.new('Pastel blue-green') | |
3383 | end | |
3384 | end | |
3385 | for _,v in pairs(MEF:GetChildren()) do | |
3386 | table.insert(KQ,v) | |
3387 | v.CanCollide=false | |
3388 | if v.Name=='Head' or v.Name=='Torso' then | |
3389 | g=AdvancingFortress['F'..v.Name] | |
3390 | else | |
3391 | g=AdvancingFortress[v.Name] | |
3392 | end | |
3393 | v.Parent=AdvancingFortress | |
3394 | v.Transparency=1 | |
3395 | weld=Instance.new('Weld',v) | |
3396 | if v.Name=='Head' then | |
3397 | weld.C0=CFrame.new(0,-1,0)*CFrame.Angles(0,-1.5,0) | |
3398 | elseif v.Name=='Torso' then | |
3399 | weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0) | |
3400 | elseif v.Name=='Left Arm' then | |
3401 | weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,1.5,0) | |
3402 | elseif v.Name=='Left Leg' then | |
3403 | weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0) | |
3404 | elseif v.Name=='Right Arm' then | |
3405 | weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0) | |
3406 | elseif v.Name=='Right Leg' then | |
3407 | weld.C0=CFrame.new(0,0,0)*CFrame.Angles(0,-1.5,0) | |
3408 | end | |
3409 | weld.Part0=v | |
3410 | weld.Part1=g | |
3411 | end-- apply costume | |
3412 | AdvancingFortress.FTorso.BrickColor=BrickColor.new('Pastel blue-green') | |
3413 | ||
3414 | AdvancingFortress.HumanoidRootPart.Name = "FHumanoidRootPart" | |
3415 | Humanoid.Animator.Parent = nil | |
3416 | AdvancingFortress.Animate.Parent = nil | |
3417 | ||
3418 | base = Instance.new("ScreenGui",plr.PlayerGui) | |
3419 | bbg = Instance.new("BillboardGui",plr.Character.Head) | |
3420 | bbg.Size = UDim2.new(0,200,0,50) | |
3421 | bbg.StudsOffset = Vector3.new(0,3,0) | |
3422 | ||
3423 | bbgTl = Instance.new("TextLabel",bbg) | |
3424 | bbgTl.BackgroundTransparency = 1 | |
3425 | bbgTl.Size = UDim2.new(10,0,1,0) | |
3426 | bbgTl.Position = UDim2.new(-4.5,0,0,0) | |
3427 | bbgTl.Font = "Code" | |
3428 | bbgTl.Text = " " | |
3429 | bbgTl.TextSize = 25 | |
3430 | bbgTl.TextStrokeColor3 = Color3.new(1,1,1) | |
3431 | bbgTl.TextColor3 = Color3.new(0,0,0) | |
3432 | bbgTl.TextStrokeTransparency = 0 | |
3433 | bbgTl.TextWrapped = true | |
3434 | ||
3435 | function Chat(msg) | |
3436 | if msg=='NANI' then | |
3437 | CFuncs.Sound.Create(948494432, Torso, 1, 1) | |
3438 | end | |
3439 | ff=game.Chat:FilterStringAsync(msg,Player,Player) | |
3440 | bbgTl.Text = ff | |
3441 | wait(1) | |
3442 | if bbgTl.Text == ff then | |
3443 | bbgTl.Text = " " | |
3444 | end | |
3445 | end | |
3446 | lknives=false | |
3447 | ||
3448 | ||
3449 | -- Fired when client sends a request to write on the sign | |
3450 | -- Called when button is clicked | |
3451 | ||
3452 | ||
3453 | plr.Chatted:connect(function(msg)-- local messageObject = getTextObject(msg, Player.UserId) | |
3454 | Chat(msg) | |
3455 | end) | |
3456 | ||
3457 | ||
3458 | local function newMotor(part0, part1, c0, c1) | |
3459 | local w = Create("Weld")({ | |
3460 | Parent = part0, | |
3461 | Part0 = part0, | |
3462 | Part1 = part1, | |
3463 | C0 = c0, | |
3464 | C1 = c1 | |
3465 | }) | |
3466 | return w | |
3467 | end | |
3468 | function clerp(a, b, t) | |
3469 | return a:lerp(b, t) | |
3470 | end | |
3471 | RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14) | |
3472 | NeckCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) | |
3473 | local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0)) | |
3474 | local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0)) | |
3475 | local RH = newMotor(Torso, RightLeg, CFrame.new(0.5, -2, 0), CFrame.new(0, 0, 0)) | |
3476 | local LH = newMotor(Torso, LeftLeg, CFrame.new(-0.5, -2, 0), CFrame.new(0, 0, 0)) | |
3477 | RootJoint.C1 = CFrame.new(0, 0, 0) | |
3478 | RootJoint.C0 = CFrame.new(0, 0, 0) | |
3479 | Torso.Neck.C1 = CFrame.new(0, 0, 0) | |
3480 | Torso.Neck.C0 = CFrame.new(0, 1.5, 0) | |
3481 | local rarmc1 = RW.C1 | |
3482 | local larmc1 = LW.C1 | |
3483 | local rlegc1 = RH.C1 | |
3484 | local llegc1 = LH.C1 | |
3485 | local resetc1 = false | |
3486 | function PlayAnimationFromTable(table, speed, bool) | |
3487 | RootJoint.C0 = clerp(RootJoint.C0, table[1], speed) | |
3488 | Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed) | |
3489 | RW.C0 = clerp(RW.C0, table[3], speed) | |
3490 | LW.C0 = clerp(LW.C0, table[4], speed) | |
3491 | RH.C0 = clerp(RH.C0, table[5], speed) | |
3492 | LH.C0 = clerp(LH.C0, table[6], speed) | |
3493 | if bool == true and resetc1 == false then | |
3494 | resetc1 = true | |
3495 | RootJoint.C1 = RootJoint.C1 | |
3496 | Torso.Neck.C1 = Torso.Neck.C1 | |
3497 | RW.C1 = rarmc1 | |
3498 | LW.C1 = larmc1 | |
3499 | RH.C1 = rlegc1 | |
3500 | LH.C1 = llegc1 | |
3501 | end | |
3502 | end | |
3503 | ArtificialHB = Create("BindableEvent", script)({Parent = script, Name = "Heartbeat"}) | |
3504 | script:WaitForChild("Heartbeat") | |
3505 | frame = 0.03333333333333333 | |
3506 | tf = 0 | |
3507 | allowframeloss = false | |
3508 | tossremainder = false | |
3509 | lastframe = tick() | |
3510 | script.Heartbeat:Fire() | |
3511 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
3512 | tf = tf + s | |
3513 | if tf >= frame then | |
3514 | if allowframeloss then | |
3515 | script.Heartbeat:Fire() | |
3516 | lastframe = tick() | |
3517 | else | |
3518 | for i = 1, math.floor(tf / frame) do | |
3519 | script.Heartbeat:Fire() | |
3520 | end | |
3521 | lastframe = tick() | |
3522 | end | |
3523 | if tossremainder then | |
3524 | tf = 0 | |
3525 | else | |
3526 | tf = tf - frame * math.floor(tf / frame) | |
3527 | end | |
3528 | end | |
3529 | end) | |
3530 | function swait(num) | |
3531 | if num == 0 or num == nil then | |
3532 | ArtificialHB.Event:wait() | |
3533 | else | |
3534 | for i = 0, num do | |
3535 | ArtificialHB.Event:wait() | |
3536 | end | |
3537 | end | |
3538 | end | |
3539 | function RemoveOutlines(part) | |
3540 | part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10 | |
3541 | end | |
3542 | CFuncs = { | |
3543 | Part = { | |
3544 | Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size) | |
3545 | local Part = Create("Part")({ | |
3546 | Parent = Parent, | |
3547 | Reflectance = Reflectance, | |
3548 | Transparency = Transparency, | |
3549 | CanCollide = false, | |
3550 | Locked = true, | |
3551 | BrickColor = BrickColor.new(tostring(BColor)), | |
3552 | Name = Name, | |
3553 | Size = Size, | |
3554 | Material = Material | |
3555 | }) | |
3556 | RemoveOutlines(Part) | |
3557 | return Part | |
3558 | end | |
3559 | }, | |
3560 | Mesh = { | |
3561 | Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale) | |
3562 | local Msh = Create(Mesh)({ | |
3563 | Parent = Part, | |
3564 | Offset = OffSet, | |
3565 | Scale = Scale | |
3566 | }) | |
3567 | if Mesh == "SpecialMesh" then | |
3568 | Msh.MeshType = MeshType | |
3569 | Msh.MeshId = MeshId | |
3570 | end | |
3571 | return Msh | |
3572 | end | |
3573 | }, | |
3574 | Weld = { | |
3575 | Create = function(Parent, Part0, Part1, C0, C1) | |
3576 | local Weld = Create("Weld")({ | |
3577 | Parent = Parent, | |
3578 | Part0 = Part0, | |
3579 | Part1 = Part1, | |
3580 | C0 = C0, | |
3581 | C1 = C1 | |
3582 | }) | |
3583 | return Weld | |
3584 | end | |
3585 | }, | |
3586 | Sound = { | |
3587 | Create = function(id, par, vol, pit) | |
3588 | local Sound = Create("Sound")({ | |
3589 | Volume = vol, | |
3590 | Pitch = pit or 1, | |
3591 | SoundId = "rbxassetid://" .. id, | |
3592 | Parent = par or workspace | |
3593 | }) | |
3594 | Sound:play() | |
3595 | game:GetService("Debris"):AddItem(Sound, 130) | |
3596 | return Sound | |
3597 | end | |
3598 | }, | |
3599 | Decal = { | |
3600 | Create = function(Color, Texture, Transparency, Name, Parent) | |
3601 | local Decal = Create("Decal")({ | |
3602 | Color3 = Color, | |
3603 | Texture = "rbxassetid://" .. Texture, | |
3604 | Transparency = Transparency, | |
3605 | Name = Name, | |
3606 | Parent = Parent | |
3607 | }) | |
3608 | return Decal | |
3609 | end | |
3610 | }, | |
3611 | BillboardGui = { | |
3612 | Create = function(Parent, Image, Position, Size) | |
3613 | local BillPar = CFuncs.Part.Create(Parent, "SmoothPlastic", 0, 1, BrickColor.new("Black"), "BillboardGuiPart", Vector3.new(1, 1, 1)) | |
3614 | BillPar.CFrame = CFrame.new(Position) | |
3615 | local Bill = Create("BillboardGui")({ | |
3616 | Parent = BillPar, | |
3617 | Adornee = BillPar, | |
3618 | Size = UDim2.new(1, 0, 1, 0), | |
3619 | SizeOffset = Vector2.new(Size, Size) | |
3620 | }) | |
3621 | local d = Create("ImageLabel", Bill)({ | |
3622 | Parent = Bill, | |
3623 | BackgroundTransparency = 1, | |
3624 | Size = UDim2.new(1, 0, 1, 0), | |
3625 | Image = "rbxassetid://" .. Image | |
3626 | }) | |
3627 | return BillPar | |
3628 | end | |
3629 | }, | |
3630 | ParticleEmitter = { | |
3631 | Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread) | |
3632 | local Particle = Create("ParticleEmitter")({ | |
3633 | Parent = Parent, | |
3634 | Color = ColorSequence.new(Color1, Color2), | |
3635 | LightEmission = LightEmission, | |
3636 | Size = Size, | |
3637 | Texture = Texture, | |
3638 | Transparency = Transparency, | |
3639 | ZOffset = ZOffset, | |
3640 | Acceleration = Accel, | |
3641 | Drag = Drag, | |
3642 | LockedToPart = LockedToPart, | |
3643 | VelocityInheritance = VelocityInheritance, | |
3644 | EmissionDirection = EmissionDirection, | |
3645 | Enabled = Enabled, | |
3646 | Lifetime = LifeTime, | |
3647 | Rate = Rate, | |
3648 | Rotation = Rotation, | |
3649 | RotSpeed = RotSpeed, | |
3650 | Speed = Speed, | |
3651 | VelocitySpread = VelocitySpread | |
3652 | }) | |
3653 | return Particle | |
3654 | end | |
3655 | }, | |
3656 | CreateTemplate = {} | |
3657 | } | |
3658 | function rayCast(Position, Direction, Range, Ignore) | |
3659 | return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore) | |
3660 | end | |
3661 | function FindNearestTorso(pos) | |
3662 | local list = game.Workspace:children() | |
3663 | local torso | |
3664 | local dist = 1000 | |
3665 | local temp, human, temp2 | |
3666 | for x = 1, #list do | |
3667 | temp2 = list[x] | |
3668 | if temp2.className == "Model" and temp2.Name ~= Character.Name then | |
3669 | temp = temp2:findFirstChild("Torso") | |
3670 | human = temp2:findFirstChild("Humanoid") | |
3671 | if temp ~= nil and human ~= nil and human.Health > 0 and dist > (temp.Position - pos).magnitude then | |
3672 | local dohit = true | |
3673 | if dohit == true then | |
3674 | torso = temp | |
3675 | dist = (temp.Position - pos).magnitude | |
3676 | end | |
3677 | end | |
3678 | end | |
3679 | end | |
3680 | return torso, dist | |
3681 | end | |
3682 | function Damage(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch) | |
3683 | if hit.Parent == nil then | |
3684 | return | |
3685 | end | |
3686 | local h = hit.Parent:FindFirstChild("Humanoid") | |
3687 | for _, v in pairs(hit.Parent:children()) do | |
3688 | c=hit.Parent:findFirstChild('HumanoidRootPart') | |
3689 | if v:IsA("Humanoid") then | |
3690 | h = v | |
3691 | if c~=nil then | |
3692 | end | |
3693 | end | |
3694 | end | |
3695 | if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Torso") ~= nil then | |
3696 | if hit.Parent:findFirstChild("DebounceHit") ~= nil and hit.Parent.DebounceHit.Value == true then | |
3697 | return | |
3698 | end | |
3699 | local c = Create("ObjectValue")({ | |
3700 | Name = "creator", | |
3701 | Value = game:service("Players").LocalPlayer, | |
3702 | Parent = h | |
3703 | }) | |
3704 | game:GetService("Debris"):AddItem(c, 0.5) | |
3705 | CFuncs.Sound.Create(HitSound, hit, 1, HitPitch) | |
3706 | local Damage = math.random(minim, maxim) | |
3707 | local blocked = false | |
3708 | local block = hit.Parent:findFirstChild("Block") | |
3709 | if block ~= nil and block.className == "IntValue" and block.Value > 0 then | |
3710 | blocked = true | |
3711 | block.Value = block.Value - 1 | |
3712 | print(block.Value) | |
3713 | end | |
3714 | if TimeStop == false then | |
3715 | h.Health = h.Health - Damage | |
3716 | ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, BrickColor.new("Pastel blue-green").Color) | |
3717 | elseif TimeStop == true then | |
3718 | repeat | |
3719 | wait() | |
3720 | until TimeStop == false | |
3721 | h.Health = h.Health - Damage / 2 | |
3722 | ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, BrickColor.new("Pastel blue-green").Color) | |
3723 | end | |
3724 | if Type == "Knockdown" then | |
3725 | local hum = hit.Parent.Humanoid | |
3726 | hum.PlatformStand = true | |
3727 | coroutine.resume(coroutine.create(function(HHumanoid) | |
3728 | swait(1) | |
3729 | HHumanoid.PlatformStand = false | |
3730 | end), hum) | |
3731 | local angle = hit.Position - (Property.Position + Vector3.new(0, 0, 0)).unit | |
3732 | local bodvol = Create("BodyVelocity")({ | |
3733 | velocity = angle * knockback, | |
3734 | P = 5000, | |
3735 | maxForce = Vector3.new(8000, 8000, 8000), | |
3736 | Parent = hit | |
3737 | }) | |
3738 | local rl = Create("BodyAngularVelocity")({ | |
3739 | P = 3000, | |
3740 | maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000, | |
3741 | angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)), | |
3742 | Parent = hit | |
3743 | }) | |
3744 | game:GetService("Debris"):AddItem(bodvol, 0.5) | |
3745 | game:GetService("Debris"):AddItem(rl, 0.5) | |
3746 | elseif Type == "Normal" then | |
3747 | local vp = Create("BodyVelocity")({ | |
3748 | P = 500, | |
3749 | maxForce = Vector3.new(math.huge, 0, math.huge), | |
3750 | velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05 | |
3751 | }) | |
3752 | if knockback > 0 then | |
3753 | vp.Parent = hit.Parent.Torso | |
3754 | end | |
3755 | game:GetService("Debris"):AddItem(vp, 0.5) | |
3756 | elseif Type == "Up" then | |
3757 | local bodyVelocity = Create("BodyVelocity")({ | |
3758 | velocity = Vector3.new(0, 20, 0), | |
3759 | P = 5000, | |
3760 | maxForce = Vector3.new(8000, 8000, 8000), | |
3761 | Parent = hit | |
3762 | }) | |
3763 | game:GetService("Debris"):AddItem(bodyVelocity, 0.5) | |
3764 | elseif Type == "DarkUp" then | |
3765 | coroutine.resume(coroutine.create(function() | |
3766 | for i = 0, 1, 0.1 do | |
3767 | swait() | |
3768 | Effects.Block.Create(BrickColor.new("Black"), hit.Parent.Torso.CFrame, 5, 5, 5, 1, 1, 1, 0.08, 1) | |
3769 | end | |
3770 | end)) | |
3771 | local bodyVelocity = Create("BodyVelocity")({ | |
3772 | velocity = Vector3.new(0, 20, 0), | |
3773 | P = 5000, | |
3774 | maxForce = Vector3.new(8000, 8000, 8000), | |
3775 | Parent = hit | |
3776 | }) | |
3777 | game:GetService("Debris"):AddItem(bodyVelocity, 1) | |
3778 | elseif Type == "Snare" then | |
3779 | local bp = Create("BodyPosition")({ | |
3780 | P = 2000, | |
3781 | D = 100, | |
3782 | maxForce = Vector3.new(math.huge, math.huge, math.huge), | |
3783 | position = hit.Parent.Torso.Position, | |
3784 | Parent = hit.Parent.Torso | |
3785 | }) | |
3786 | game:GetService("Debris"):AddItem(bp, 1) | |
3787 | elseif Type == "Freeze" then | |
3788 | local BodPos = Create("BodyPosition")({ | |
3789 | P = 50000, | |
3790 | D = 1000, | |
3791 | maxForce = Vector3.new(math.huge, math.huge, math.huge), | |
3792 | position = hit.Parent.Torso.Position, | |
3793 | Parent = hit.Parent.Torso | |
3794 | }) | |
3795 | local BodGy = Create("BodyGyro")({ | |
3796 | maxTorque = Vector3.new(400000, 400000, 400000) * math.huge, | |
3797 | P = 20000, | |
3798 | Parent = hit.Parent.Torso, | |
3799 | cframe = hit.Parent.Torso.CFrame | |
3800 | }) | |
3801 | hit.Parent.Torso.Anchored = true | |
3802 | coroutine.resume(coroutine.create(function(Part) | |
3803 | swait(1.5) | |
3804 | Part.Anchored = false | |
3805 | end), hit.Parent.Torso) | |
3806 | game:GetService("Debris"):AddItem(BodPos, 3) | |
3807 | game:GetService("Debris"):AddItem(BodGy, 3) | |
3808 | end | |
3809 | local debounce = Create("BoolValue")({ | |
3810 | Name = "DebounceHit", | |
3811 | Parent = hit.Parent, | |
3812 | Value = true | |
3813 | }) | |
3814 | game:GetService("Debris"):AddItem(debounce, Delay) | |
3815 | c = Create("ObjectValue")({ | |
3816 | Name = "creator", | |
3817 | Value = Player, | |
3818 | Parent = h | |
3819 | }) | |
3820 | game:GetService("Debris"):AddItem(c, 0.5) | |
3821 | end | |
3822 | end | |
3823 | function ShowDamage(Pos, Text, Time, Color) | |
3824 | local Rate = 0.03333333333333333 | |
3825 | local Pos = Pos or Vector3.new(0, 0, 0) | |
3826 | local Text = Text or "" | |
3827 | local Time = Time or 2 | |
3828 | local Color = Color or Color3.new(1, 0, 1) | |
3829 | local EffectPart = CFuncs.Part.Create(workspace, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", Vector3.new(0, 0, 0)) | |
3830 | EffectPart.Anchored = true | |
3831 | local BillboardGui = Create("BillboardGui")({ | |
3832 | Size = UDim2.new(3, 0, 3, 0), | |
3833 | Adornee = EffectPart, | |
3834 | Parent = EffectPart | |
3835 | }) | |
3836 | local TextLabel = Create("TextLabel")({ | |
3837 | BackgroundTransparency = 1, | |
3838 | Size = UDim2.new(1, 0, 1, 0), | |
3839 | Text = Text, | |
3840 | Font = "SciFi", | |
3841 | TextColor3 = Color, | |
3842 | TextScaled = true, | |
3843 | Parent = BillboardGui | |
3844 | }) | |
3845 | game.Debris:AddItem(EffectPart, Time) | |
3846 | EffectPart.Parent = game:GetService("Workspace") | |
3847 | delay(0, function() | |
3848 | local Frames = Time / Rate | |
3849 | for Frame = 1, Frames do | |
3850 | wait(Rate) | |
3851 | local Percent = Frame / Frames | |
3852 | EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0) | |
3853 | TextLabel.TextTransparency = Percent | |
3854 | end | |
3855 | if EffectPart and EffectPart.Parent then | |
3856 | EffectPart:Destroy() | |
3857 | end | |
3858 | end) | |
3859 | end | |
3860 | local STDamage = false | |
3861 | function MagnitudeDamage(Part, Magnitude, MinimumDamage, MaximumDamage, KnockBack, Type, HitSound, HitPitch) | |
3862 | for _, c in pairs(workspace:children()) do | |
3863 | local hum = c:findFirstChild("Humanoid") | |
3864 | if hum ~= nil then | |
3865 | local head = c:findFirstChild("Torso") | |
3866 | if head ~= nil then | |
3867 | local targ = head.Position - Part.Position | |
3868 | local mag = targ.magnitude | |
3869 | if Magnitude >= mag and c.Name ~= Player.Name then | |
3870 | Damage(head, head, MinimumDamage, MaximumDamage, KnockBack, Type, RootPart, 0.1, HitSound, HitPitch) | |
3871 | if STDamage == true then | |
3872 | for i = 1, 3 do | |
3873 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 1, 1, 1, 4, 4, 4, 0.07, 1) | |
3874 | end | |
3875 | for i = 1, 10 do | |
3876 | CamShake(1, 70000) | |
3877 | Effects.Break.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 1, 1, 1) | |
3878 | end | |
3879 | elseif STDamage == false then | |
3880 | CamShake(1, 90000) | |
3881 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.07, 1) | |
3882 | for i = 1, 2 do | |
3883 | Effects.Break.Create(BrickColor.new("Pastel blue-green"), head.CFrame, 0.4, 0.4, 0.4) | |
3884 | end | |
3885 | end | |
3886 | end | |
3887 | end | |
3888 | end | |
3889 | end | |
3890 | end | |
3891 | --[[ | |
3892 | HHandle = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HHandle", Vector3.new(1.09999979, 0.299999923, 1.0999999)) | |
3893 | HHandleWeld = CFuncs.Weld.Create(m, Head, HHandle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0646438599, -0.0500068665, -0.0646400452, -0.707107365, -3.21031663E-8, 0.707106411, -8.19564079E-8, 1.00000119, -1.41561088E-7, -0.707106352, 1.38630043E-7, -0.707107484)) | |
3894 | Eye1 = CFuncs.Part.Create(m, Enum.Material.Neon, 0, 1, "White", "Eye1", Vector3.new(0.400000006, 0.200000003, 0.200000003)) | |
3895 | PartWeld = CFuncs.Weld.Create(m, HHandle, Eye1, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0381011963, -0.0574798584, 0.471725464, -2.89082527E-6, 0.173647985, -0.984807968, -6.2584877E-7, 0.984808922, 0.173648104, 1.00000012, 1.02902288E-6, -2.77161598E-6)) | |
3896 | CFuncs.Mesh.Create("SpecialMesh", Eye1, Enum.MeshType.Sphere, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3897 | Eye2 = CFuncs.Part.Create(m, Enum.Material.Neon, 0, 1, "White", "Eye2", Vector3.new(0.400000006, 0.200000003, 0.200000003)) | |
3898 | PartWeld = CFuncs.Weld.Create(m, HHandle, Eye2, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0115432739, -0.0487277508, 0.482452393, -0.981060266, -0.173648134, -0.0858327746, -0.172987267, 0.984808922, -0.0151339322, 0.0871568322, 3.96735317E-7, -0.996194839)) | |
3899 | CFuncs.Mesh.Create("SpecialMesh", Eye2, Enum.MeshType.Sphere, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3900 | THandle = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Medium stone grey", "THandle", Vector3.new(1, 0.799999893, 1)) | |
3901 | THandleWeld = CFuncs.Weld.Create(m, Torso, THandle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3902 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.80000019, 0.300000012, 1.80000007)) | |
3903 | PartWeld = CFuncs.Weld.Create(m, THandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-6.10351563E-5, -1.04342794, -0.404396057, 1, -8.19564079E-8, 5.96046519E-8, -1.01078633E-7, 0.939694166, -0.342019171, 1.52638329E-8, 0.34201926, 0.939693213)) | |
3904 | CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3905 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 1.10000002, 0.300000012)) | |
3906 | PartWeld = CFuncs.Weld.Create(m, THandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-5.34057617E-5, -0.943422318, -1.35441589, 1, -8.19564079E-8, 5.96046519E-8, -1.01078633E-7, 0.939694166, -0.342019171, 1.52638329E-8, 0.34201926, 0.939693213)) | |
3907 | CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3908 | --]] | |
3909 | AHandleR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "AHandleR", Vector3.new(0.799999952, 0.800000012, 1.22000003)) | |
3910 | AHandleRWeld = CFuncs.Weld.Create(m, RightArm, AHandleR, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.209915161, 0.00999641418, -3.81469727E-6, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3911 | --[[ | |
3912 | ||
3913 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.899999976, 1.01999998)) | |
3914 | PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0999984741, 0.550004005, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3915 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
3916 | PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.150001526, 0.200003624, -0.359994888, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3917 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
3918 | PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149993896, 0.20000267, 0.359992981, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3919 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.20000005, 0.800000012, 1.20000005)) | |
3920 | PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.209899902, -0.809997559, 5.7220459E-6, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024)) | |
3921 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999988, 1.01999998)) | |
3922 | PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.300003052, 0.650004387, 1.71661377E-5, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3923 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.699999988, 1.01999998)) | |
3924 | PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149993896, 0.650003433, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3925 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999928, 0.520000041)) | |
3926 | PartWeld = CFuncs.Weld.Create(m, AHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.199996948, -0.049996376, -3.81469727E-6, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3927 | --]] | |
3928 | HitboxR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HitboxR", Vector3.new(0.799999952, 0.800000012, 1.22000003)) | |
3929 | ||
3930 | HitboxRWeld = CFuncs.Weld.Create(m, AHandleR, HitboxR, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.700003624, 0, 1, -8.19564079E-8, 5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, 5.96046519E-8, -1.41561088E-7, 1.00000024)) | |
3931 | AHandleL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "AHandleL", Vector3.new(0.800000072, 0.800000012, 1.22000003)) | |
3932 | AHandleLWeld = CFuncs.Weld.Create(m, LeftArm, AHandleL, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.210014343, 0.00999736786, 1.14440918E-5, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024)) | |
3933 | HitboxL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "HitboxL", Vector3.new(0.800000072, 0.800000012, 1.22000003)) | |
3934 | HitboxLWeld = CFuncs.Weld.Create(m, AHandleL, HitboxL, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.700003624, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3935 | ||
3936 | ||
3937 | --[[ | |
3938 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
3939 | PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149986267, 0.200001717, -0.360012054, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3940 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999928, 0.520000041)) | |
3941 | PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.199989319, -0.0499982834, -9.53674316E-6, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3942 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
3943 | PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149986267, 0.200001717, 0.359992981, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3944 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.20000005, 0.800000012, 1.20000005)) | |
3945 | PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.21005249, -0.81000042, 2.28881836E-5, -1, -8.19564079E-8, -5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, -5.96046519E-8, -1.41561088E-7, -1.00000024)) | |
3946 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.899999976, 1.01999998)) | |
3947 | PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0999984741, 0.550003052, -5.7220459E-6, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3948 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.200000003, 0.699999988, 1.01999998)) | |
3949 | PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.299995422, 0.650003433, -3.81469727E-6, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3950 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.300000012, 0.699999988, 1.01999998)) | |
3951 | PartWeld = CFuncs.Weld.Create(m, AHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.149993896, 0.65000248, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3952 | LHandleR = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "LHandleR", Vector3.new(1.02999997, 1.00999999, 1.19000006)) | |
3953 | LHandleRWeld = CFuncs.Weld.Create(m, RightLeg, LHandleR, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00498962402, -0.0950021744, 0.00499534607, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024)) | |
3954 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000012, 0.800000012, 0.200000003)) | |
3955 | PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00498962402, -0.00499916077, -0.604999542, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3956 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 1.00999999, 1.19000006)) | |
3957 | PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.600002289, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3958 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 0.699999928, 1.19000006)) | |
3959 | PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -0.454998016, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3960 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.400000006, 1.20000005, 0.200000003)) | |
3961 | PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00499725342, -0.00499916077, -0.604999542, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3962 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000131, 1.20000005, 0.800000012)) | |
3963 | PartWeld = CFuncs.Weld.Create(m, LHandleR, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00499725342, 0.0149993896, 0.00500297546, 2.28095047E-7, 1.00000775, 2.99581131E-7, -1.00000417, 5.63755016E-8, -4.06898749E-7, -2.98379774E-7, 2.07959161E-8, 1.0000037)) | |
3964 | CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3965 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
3966 | WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.604999542, -0.504998207, 0.29499054, -2.98023224E-8, -6.70552254E-8, -1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8)) | |
3967 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3968 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
3969 | WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.60499382, -0.495001793, 0.305000305, -5.96046519E-8, -1.41561088E-7, -1.00000024, -8.19564079E-8, -1.00000119, -1.41561088E-7, -1, -8.19564079E-8, -5.96046519E-8)) | |
3970 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3971 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
3972 | WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.604999542, -0.495001793, 0.29499054, 2.98023224E-8, 6.70552254E-8, 1.00000012, -3.7252903E-8, -1.0000006, -7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8)) | |
3973 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3974 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
3975 | WedgeWeld = CFuncs.Weld.Create(m, LHandleR, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.604999542, -0.504998207, 0.305000305, 2.98023224E-8, 6.70552254E-8, 1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, -1, -4.47034836E-8, -2.98023224E-8)) | |
3976 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3977 | LHandleL = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "LHandleL", Vector3.new(1.02999997, 1.00999999, 1.19000006)) | |
3978 | LHandleLWeld = CFuncs.Weld.Create(m, LeftLeg, LHandleL, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00498199463, -0.095000267, 0.00502204895, -1, 8.19564079E-8, -5.96046519E-8, -8.19564079E-8, 1.00000119, -1.41561088E-7, -5.96046519E-8, 1.41561088E-7, -1.00000024)) | |
3979 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 1.00999999, 1.19000006)) | |
3980 | PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.600001335, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3981 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.400000006, 1.20000005, 0.300000012)) | |
3982 | PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00499725342, -0.00500106812, -0.554998398, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3983 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(1.02999997, 0.699999928, 1.19000006)) | |
3984 | PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -0.454999924, 0, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3985 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000131, 1.20000005, 0.800000012)) | |
3986 | PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00499534607, 0.0149993896, 0.00500297546, 2.28095047E-7, 1.00000775, 2.99581131E-7, -1.00000417, 5.63755016E-8, -4.06898749E-7, -2.98379774E-7, 2.07959161E-8, 1.0000037)) | |
3987 | CFuncs.Mesh.Create("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3988 | Part = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Part", Vector3.new(0.800000012, 0.800000012, 0.300000012)) | |
3989 | PartWeld = CFuncs.Weld.Create(m, LHandleL, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.00498962402, -0.00500106812, -0.554998398, 1, 8.19564079E-8, 5.96046519E-8, 8.19564079E-8, 1.00000119, 1.41561088E-7, 5.96046519E-8, 1.41561088E-7, 1.00000024)) | |
3990 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
3991 | WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.554998398, -0.505000114, 0.305000305, 2.98023224E-8, 6.70552254E-8, 1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, -1, -4.47034836E-8, -2.98023224E-8)) | |
3992 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3993 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
3994 | WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.554998398, -0.505000114, 0.29499054, -2.98023224E-8, -6.70552254E-8, -1.00000012, 3.7252903E-8, 1.0000006, 7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8)) | |
3995 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3996 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
3997 | WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.554998398, -0.494999886, 0.29499054, 2.98023224E-8, 6.70552254E-8, 1.00000012, -3.7252903E-8, -1.0000006, -7.4505806E-8, 1, 4.47034836E-8, 2.98023224E-8)) | |
3998 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
3999 | Wedge = CFuncs.Part.Create(m, Enum.Material.SmoothPlastic, 0, 1, "Camo", "Wedge", Vector3.new(0.300000012, 0.200000003, 0.200000003)) | |
4000 | WedgeWeld = CFuncs.Weld.Create(m, LHandleL, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.554998398, -0.494999886, 0.305000305, -5.96046519E-8, -1.41561088E-7, -1.00000024, -8.19564079E-8, -1.00000119, -1.41561088E-7, -1, -8.19564079E-8, -5.96046519E-8)) | |
4001 | CFuncs.Mesh.Create("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)) | |
4002 | --]] | |
4003 | Shield = CFuncs.Part.Create(m, "Neon", 0, 0.5, "Pastle brown", "Part", Vector3.new(9.1, 8.5, 0.2)) | |
4004 | CFuncs.Mesh.Create("SpecialMesh", Shield, "FileMesh", "rbxassetid://708292865", Vector3.new(0, 0, 0), Vector3.new(0.04, 0.04, 0.04)) | |
4005 | Shield.Parent = nil | |
4006 | ||
4007 | EffectModel = Create("Model")({Parent = Character, Name = "Effects"}) | |
4008 | Effects = { | |
4009 | Block = { | |
4010 | Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type) | |
4011 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new()) | |
4012 | prt.Anchored = true | |
4013 | prt.CFrame = cframe | |
4014 | local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4015 | game:GetService("Debris"):AddItem(prt, 10) | |
4016 | if Type == 1 or Type == nil then | |
4017 | table.insert(Effects, { | |
4018 | prt, | |
4019 | "Block1", | |
4020 | delay, | |
4021 | x3, | |
4022 | y3, | |
4023 | z3, | |
4024 | msh | |
4025 | }) | |
4026 | elseif Type == 2 then | |
4027 | table.insert(Effects, { | |
4028 | prt, | |
4029 | "Block2", | |
4030 | delay, | |
4031 | x3, | |
4032 | y3, | |
4033 | z3, | |
4034 | msh | |
4035 | }) | |
4036 | end | |
4037 | end | |
4038 | }, | |
4039 | Cylinder = { | |
4040 | Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
4041 | local prt = CFuncs.Part .. Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.2, 0.2, 0.2)) | |
4042 | prt.Anchored = true | |
4043 | prt.CFrame = cframe | |
4044 | local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4045 | game:GetService("Debris"):AddItem(prt, 2) | |
4046 | Effects[#Effects + 1] = { | |
4047 | prt, | |
4048 | "Cylinder", | |
4049 | delay, | |
4050 | x3, | |
4051 | y3, | |
4052 | z3 | |
4053 | } | |
4054 | end | |
4055 | }, | |
4056 | Head = { | |
4057 | Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
4058 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new()) | |
4059 | prt.Anchored = true | |
4060 | prt.CFrame = cframe | |
4061 | local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Head", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4062 | game:GetService("Debris"):AddItem(prt, 10) | |
4063 | table.insert(Effects, { | |
4064 | prt, | |
4065 | "Cylinder", | |
4066 | delay, | |
4067 | x3, | |
4068 | y3, | |
4069 | z3, | |
4070 | msh | |
4071 | }) | |
4072 | end | |
4073 | }, | |
4074 | Sphere = { | |
4075 | Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
4076 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new()) | |
4077 | prt.Anchored = true | |
4078 | prt.CFrame = cframe | |
4079 | local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4080 | game:GetService("Debris"):AddItem(prt, 10) | |
4081 | table.insert(Effects, { | |
4082 | prt, | |
4083 | "Cylinder", | |
4084 | delay, | |
4085 | x3, | |
4086 | y3, | |
4087 | z3, | |
4088 | msh | |
4089 | }) | |
4090 | end | |
4091 | }, | |
4092 | Sphere2 = { | |
4093 | Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
4094 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new()) | |
4095 | prt.Anchored = true | |
4096 | prt.CFrame = cframe | |
4097 | local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4098 | game:GetService("Debris"):AddItem(prt, 10) | |
4099 | table.insert(Effects, { | |
4100 | prt, | |
4101 | "Cylinder", | |
4102 | delay, | |
4103 | x3, | |
4104 | y3, | |
4105 | z3, | |
4106 | msh | |
4107 | }) | |
4108 | end | |
4109 | }, | |
4110 | Elec = { | |
4111 | Create = function(cff, x, y, z) | |
4112 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, BrickColor.new("Pastel blue-green"), "Part", Vector3.new(1, 1, 1)) | |
4113 | prt.Anchored = true | |
4114 | prt.CFrame = cff * CFrame.new(math.random(-x, x), math.random(-y, y), math.random(-z, z)) | |
4115 | prt.CFrame = CFrame.new(prt.Position) | |
4116 | game:GetService("Debris"):AddItem(prt, 2) | |
4117 | local xval = math.random() / 2 | |
4118 | local yval = math.random() / 2 | |
4119 | local zval = math.random() / 2 | |
4120 | local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(xval, yval, zval)) | |
4121 | table.insert(Effects, { | |
4122 | prt, | |
4123 | "Elec", | |
4124 | 0.1, | |
4125 | x, | |
4126 | y, | |
4127 | z, | |
4128 | xval, | |
4129 | yval, | |
4130 | zval | |
4131 | }) | |
4132 | end | |
4133 | }, | |
4134 | Ring = { | |
4135 | Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
4136 | local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
4137 | prt.Anchored = true | |
4138 | prt.CFrame = cframe | |
4139 | local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4140 | game:GetService("Debris"):AddItem(prt, 10) | |
4141 | table.insert(Effects, { | |
4142 | prt, | |
4143 | "Cylinder", | |
4144 | delay, | |
4145 | x3, | |
4146 | y3, | |
4147 | z3, | |
4148 | msh | |
4149 | }) | |
4150 | end | |
4151 | }, | |
4152 | Wave = { | |
4153 | Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
4154 | local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
4155 | prt.Anchored = true | |
4156 | prt.CFrame = cframe | |
4157 | local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4158 | game:GetService("Debris"):AddItem(prt, 10) | |
4159 | table.insert(Effects, { | |
4160 | prt, | |
4161 | "Cylinder", | |
4162 | delay, | |
4163 | x3, | |
4164 | y3, | |
4165 | z3, | |
4166 | msh | |
4167 | }) | |
4168 | end | |
4169 | }, | |
4170 | Break = { | |
4171 | Create = function(brickcolor, cframe, x1, y1, z1) | |
4172 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5)) | |
4173 | prt.Anchored = true | |
4174 | prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
4175 | local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4176 | local num = math.random(10, 50) / 1000 | |
4177 | game:GetService("Debris"):AddItem(prt, 10) | |
4178 | table.insert(Effects, { | |
4179 | prt, | |
4180 | "Shatter", | |
4181 | num, | |
4182 | prt.CFrame, | |
4183 | math.random() - math.random(), | |
4184 | 0, | |
4185 | math.random(50, 100) / 100 | |
4186 | }) | |
4187 | end | |
4188 | }, | |
4189 | Fire = { | |
4190 | Create = function(brickcolor, cframe, x1, y1, z1, delay) | |
4191 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new()) | |
4192 | prt.Anchored = true | |
4193 | prt.CFrame = cframe | |
4194 | msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4195 | game:GetService("Debris"):AddItem(prt, 10) | |
4196 | table.insert(Effects, { | |
4197 | prt, | |
4198 | "Fire", | |
4199 | delay, | |
4200 | 1, | |
4201 | 1, | |
4202 | 1, | |
4203 | msh | |
4204 | }) | |
4205 | end | |
4206 | }, | |
4207 | FireWave = { | |
4208 | Create = function(brickcolor, cframe, x1, y1, z1) | |
4209 | local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 1, brickcolor, "Effect", Vector3.new()) | |
4210 | prt.Anchored = true | |
4211 | prt.CFrame = cframe | |
4212 | msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
4213 | local d = Create("Decal")({ | |
4214 | Parent = prt, | |
4215 | Texture = "rbxassetid://26356434", | |
4216 | Face = "Top" | |
4217 | }) | |
4218 | local d = Create("Decal")({ | |
4219 | Parent = prt, | |
4220 | Texture = "rbxassetid://26356434", | |
4221 | Face = "Bottom" | |
4222 | }) | |
4223 | game:GetService("Debris"):AddItem(prt, 10) | |
4224 | table.insert(Effects, { | |
4225 | prt, | |
4226 | "FireWave", | |
4227 | 1, | |
4228 | 30, | |
4229 | math.random(400, 600) / 100, | |
4230 | msh | |
4231 | }) | |
4232 | end | |
4233 | }, | |
4234 | Lightning = { | |
4235 | Create = function(p0, p1, tym, ofs, col, th, tra, last) | |
4236 | local magz = (p0 - p1).magnitude | |
4237 | local curpos = p0 | |
4238 | local trz = { | |
4239 | -ofs, | |
4240 | ofs | |
4241 | } | |
4242 | for i = 1, tym do | |
4243 | local li = CFuncs.Part.Create(EffectModel, "Neon", 0, tra or 0.4, col, "Ref", Vector3.new(th, th, magz / tym)) | |
4244 | local ofz = Vector3.new(trz[math.random(1, 2)], trz[math.random(1, 2)], trz[math.random(1, 2)]) | |
4245 | local trolpos = CFrame.new(curpos, p1) * CFrame.new(0, 0, magz / tym).p + ofz | |
4246 | li.Material = "Neon" | |
4247 | if tym == i then | |
4248 | local magz2 = (curpos - p1).magnitude | |
4249 | li.Size = Vector3.new(th, th, magz2) | |
4250 | li.CFrame = CFrame.new(curpos, p1) * CFrame.new(0, 0, -magz2 / 2) | |
4251 | table.insert(Effects, { | |
4252 | li, | |
4253 | "Disappear", | |
4254 | last | |
4255 | }) | |
4256 | else | |
4257 | li.CFrame = CFrame.new(curpos, trolpos) * CFrame.new(0, 0, magz / tym / 2) | |
4258 | curpos = li.CFrame * CFrame.new(0, 0, magz / tym / 2).p | |
4259 | game.Debris:AddItem(li, 10) | |
4260 | table.insert(Effects, { | |
4261 | li, | |
4262 | "Disappear", | |
4263 | last | |
4264 | }) | |
4265 | end | |
4266 | end | |
4267 | end | |
4268 | }, | |
4269 | EffectTemplate = {} | |
4270 | } | |
4271 | local Invisible = true | |
4272 | function Reappear() | |
4273 | for _, i in pairs(AdvancingFortress:children()) do | |
4274 | if i:IsA("BasePart") then | |
4275 | coroutine.resume(coroutine.create(function(Part) | |
4276 | for i = 0, 1, 0.3 do | |
4277 | swait() | |
4278 | Part.Transparency = -i | |
4279 | end | |
4280 | Part.Transparency = 0 | |
4281 | end), i) | |
4282 | end | |
4283 | end | |
4284 | for _, i in pairs(m:children()) do | |
4285 | if i:IsA("BasePart") then | |
4286 | coroutine.resume(coroutine.create(function(Part) | |
4287 | for i = 0, 1, 0.3 do | |
4288 | swait() | |
4289 | Part.Transparency = i | |
4290 | end | |
4291 | Part.Transparency = 0 | |
4292 | end), i) | |
4293 | end | |
4294 | end | |
4295 | end | |
4296 | function ReappearArmorOnly() | |
4297 | for _, i in pairs(m:children()) do | |
4298 | if i:IsA("BasePart") then | |
4299 | coroutine.resume(coroutine.create(function(Part) | |
4300 | for i = 0, 1, 0.3 do | |
4301 | swait() | |
4302 | Part.Transparency = i | |
4303 | end | |
4304 | Part.Transparency = 0 | |
4305 | for _,v in pairs(KQ) do | |
4306 | St=v.Weld.Part1.Name | |
4307 | if St=='FHead' then | |
4308 | St='Head' | |
4309 | end | |
4310 | v.Weld.Part1=Character[St] | |
4311 | end | |
4312 | end), i) | |
4313 | end | |
4314 | end | |
4315 | end | |
4316 | function Disappear() | |
4317 | for _, i in pairs(AdvancingFortress:children()) do | |
4318 | if i:IsA("BasePart") then | |
4319 | coroutine.resume(coroutine.create(function(Part) | |
4320 | for i = 0, 1, 0.3 do | |
4321 | swait() | |
4322 | Part.Transparency = i | |
4323 | end | |
4324 | Part.Transparency = 1 | |
4325 | end), i) | |
4326 | end | |
4327 | end | |
4328 | for _, i in pairs(m:children()) do | |
4329 | if i:IsA("BasePart") then | |
4330 | coroutine.resume(coroutine.create(function(Part) | |
4331 | for i = 0, 1, 0.3 do | |
4332 | swait() | |
4333 | Part.Transparency = i | |
4334 | end | |
4335 | Part.Transparency = 1 | |
4336 | end), i) | |
4337 | end | |
4338 | end | |
4339 | end | |
4340 | function DisappearArmorOnly() | |
4341 | for _, i in pairs(m:children()) do | |
4342 | if i:IsA("BasePart") then | |
4343 | coroutine.resume(coroutine.create(function(Part) | |
4344 | for i = 0, 1, 0.3 do | |
4345 | swait() | |
4346 | Part.Transparency = i | |
4347 | end | |
4348 | Part.Transparency = 1 | |
4349 | for _,v in pairs(KQ) do | |
4350 | St=v.Weld.Part1.Name | |
4351 | if St=='Head' then | |
4352 | St='FHead' | |
4353 | end | |
4354 | v.Weld.Part1=AdvancingFortress[St] | |
4355 | end | |
4356 | end), i) | |
4357 | end | |
4358 | end | |
4359 | end | |
4360 | function CamShake(time, freq) | |
4361 | coroutine.resume(coroutine.create(function() | |
4362 | local cam = game:GetService("Workspace").CurrentCamera | |
4363 | local time = 10 | |
4364 | local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0) | |
4365 | if math.random(1, 2) == 1 then | |
4366 | seed = Vector3.new(-seed.x, seed.y, 0) | |
4367 | end | |
4368 | if math.random(1, 2) == 1 then | |
4369 | seed = Vector3.new(seed.x, -seed.y, 0) | |
4370 | end | |
4371 | cam.CoordinateFrame = CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude) | |
4372 | for i = 1, time do | |
4373 | cam.CoordinateFrame = CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude) | |
4374 | wait() | |
4375 | end | |
4376 | end)) | |
4377 | end | |
4378 | local ora = false | |
4379 | function ORA() | |
4380 | attack = true | |
4381 | local S = CFuncs.Sound.Create("", Torso, 3, 1) | |
4382 | S.Looped = true | |
4383 | if ora == true then | |
4384 | while ora == true do | |
4385 | CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2)) | |
4386 | MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1) | |
4387 | for i = 0, 1, 0.8 do | |
4388 | swait() | |
4389 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5) | |
4390 | PlayAnimationFromTable({ | |
4391 | CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4392 | CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4393 | CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4394 | CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4395 | CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4396 | CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4397 | }, 0.8, false) | |
4398 | end | |
4399 | CFuncs.Sound.Create("200632136", HitboxR, 0.3, math.random(1, 1.2)) | |
4400 | MagnitudeDamage(HitboxR, 5, 4, 10, 0, "Normal", "260430117", 1) | |
4401 | for i = 0, 1, 0.8 do | |
4402 | swait() | |
4403 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5) | |
4404 | PlayAnimationFromTable({ | |
4405 | CFrame.new(1.1920929E-6, -0.0170394331, -0.52941519, 0.70710516, -2.21270369E-7, -0.707108498, 0.18301405, 0.965925574, 0.183012888, 0.683014154, -0.258820117, 0.683010995) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4406 | CFrame.new(-1.22189522E-6, 1.49999356, 1.04308128E-6, 0.707110465, 0.122788236, 0.696360528, -1.4748274E-6, 0.98480773, -0.173648238, -0.707103193, 0.122787461, 0.696368098) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4407 | CFrame.new(1.44562268, 0.333473027, -0.475224167, 0.907739162, 0.217196256, 0.358959734, 0.40125221, -0.199453548, -0.893991232, -0.122576535, 0.955528319, -0.268199235) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4408 | CFrame.new(-1.884794, 0.881342709, -0.770847201, 0.0912726, 0.688403964, -0.719562054, -0.91795665, -0.221949756, -0.328776807, -0.386037856, 0.690535009, 0.611666858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4409 | CFrame.new(0.789779902, -1.8586235, 0.161380947, 0.965926766, -0.258817255, -8.10623169E-6, 0.243211254, 0.907672405, 0.342022836, -0.0885141194, -0.330371499, 0.939691722) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4410 | CFrame.new(-0.73783946, -1.45406294, -0.215006173, 0.882573366, -0.0180292428, 0.469829261, -0.163172901, 0.925412893, 0.342031717, -0.440952569, -0.378531486, 0.813802838) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4411 | }, 0.8, false) | |
4412 | end | |
4413 | CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2)) | |
4414 | MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1) | |
4415 | for i = 0, 1, 0.8 do | |
4416 | swait() | |
4417 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5) | |
4418 | PlayAnimationFromTable({ | |
4419 | CFrame.new(0.215482175, -0.0393944569, -0.126133978, 0.259671897, -0.351393819, 0.8994959, -0.075478971, 0.921212733, 0.381667405, -0.962742627, -0.167001322, 0.212690249) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4420 | CFrame.new(-1.26510859E-5, 1.49999118, -2.16066837E-7, 0.420251548, -0.0215960592, -0.90715003, -0.100918382, 0.992402375, -0.0703775883, 0.901778162, 0.12112467, 0.414879382) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4421 | CFrame.new(1.81840861, 0.705381036, -0.347923756, -0.236346364, -0.883376777, 0.404705286, 0.945798516, -0.113677993, 0.304209948, -0.222726092, 0.454668403, 0.862362981) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4422 | CFrame.new(-1.21960759, 0.420275182, -0.728423595, -0.57802856, -0.255150676, 0.775100708, 0.665436089, -0.697164714, 0.266751111, 0.472311139, 0.669969678, 0.572767615) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4423 | CFrame.new(0.620917439, -1.53014767, -0.12091887, 0.707106113, 0.241845652, -0.66446346, -1.2293458E-6, 0.939692676, 0.342019886, 0.707107484, -0.241843566, 0.664462805) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4424 | CFrame.new(-0.873213649, -1.89646459, -0.100004375, 0.933012128, 0.353242815, -0.0686147735, -0.258823931, 0.791241407, 0.554028153, 0.249997303, -0.499155849, 0.829665601) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4425 | }, 0.8, false) | |
4426 | end | |
4427 | CFuncs.Sound.Create("200632136", HitboxR, 0.3, math.random(1, 1.2)) | |
4428 | MagnitudeDamage(HitboxR, 5, 4, 10, 0, "Normal", "260430117", 1) | |
4429 | for i = 0, 1, 0.8 do | |
4430 | swait() | |
4431 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -4), 0.5) | |
4432 | PlayAnimationFromTable({ | |
4433 | CFrame.new(0.299998224, -0.0468490347, -0.211314023, 0.642786682, -2.87348001E-7, -0.766045272, 0.323744863, 0.906307757, 0.271653205, 0.694272637, -0.42261824, 0.582562685) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4434 | CFrame.new(2.71201134E-6, 1.4999969, 8.94069672E-7, 0.642777503, 0.133020476, 0.754416466, 4.31999706E-6, 0.984809279, -0.173647597, -0.766052961, 0.111620098, 0.633012772) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4435 | CFrame.new(1.27057993, 0.327670783, -0.599993467, 0.638493001, 0.280156553, -0.716825664, -0.769049883, 0.196164608, -0.608343422, -0.0298155248, 0.939697862, 0.340704083) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4436 | CFrame.new(-1.86040878, 1.02262986, -0.452570885, 0.386218816, 0.717701018, -0.579433978, -0.403004408, -0.433759809, -0.805879354, -0.829712272, 0.544763446, 0.121709965) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4437 | CFrame.new(0.779964924, -1.75316048, -0.0263362825, 0.826099217, -0.36394459, 0.43023771, 0.181541473, 0.894650102, 0.40822047, -0.533481896, -0.259124577, 0.805140793) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4438 | CFrame.new(-0.724003315, -1.47219872, -0.266945302, 0.766038954, -0.166370958, 0.620890498, 4.09781933E-6, 0.965925932, 0.258819997, -0.642794192, -0.198263675, 0.739937425) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4439 | }, 0.8, false) | |
4440 | end | |
4441 | CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2)) | |
4442 | MagnitudeDamage(HitboxL, 5, 4, 10, 0, "Normal", "260430117", 1) | |
4443 | end | |
4444 | end | |
4445 | S:Stop() | |
4446 | local S2 = CFuncs.Sound.Create("", Torso, 1.5, 1) | |
4447 | for i = 0, 1, 0.13 do | |
4448 | swait() | |
4449 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -3), 0.5) | |
4450 | PlayAnimationFromTable({ | |
4451 | CFrame.new(2.68220901E-6, -0.0739577487, 0.0232374109, 0.707105994, -3.47710994E-7, -0.707107604, -0.122787997, 0.98480767, -0.122788213, 0.696364999, 0.173648596, 0.696363389) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4452 | CFrame.new(-5.36441803E-7, 1.49999356, -1.28149986E-6, 0.707105994, -0.122788511, 0.696365297, -3.47710994E-7, 0.984808028, 0.173649326, -0.707107604, -0.122788727, 0.696363688) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4453 | CFrame.new(1.13747835, 0.382733107, -0.729447305, 0.579597414, 0.772029877, -0.260839432, -0.351051509, -0.0523141921, -0.934893906, -0.735411942, 0.633429527, 0.240701318) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4454 | CFrame.new(-1.53455412, 0.605712295, -0.542039633, 0.786121905, 0.427828372, -0.446066588, -0.606968522, 0.398195386, -0.687771559, -0.116626531, 0.811420619, 0.572708428) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4455 | CFrame.new(0.903839946, -1.70734286, 0.373858094, 0.863655448, -0.430708885, 0.261895239, 0.187955216, 0.757234871, 0.625514567, -0.46773085, -0.491004646, 0.734943748) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4456 | CFrame.new(-0.596739769, -1.62411702, -0.0967329144, 0.725493789, -0.291957259, 0.623233199, -0.081900157, 0.86250174, 0.499382436, -0.683338165, -0.41334182, 0.601828396) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4457 | }, 0.2, false) | |
4458 | end | |
4459 | CFuncs.Sound.Create("471881954", HitboxR, 1, 1) | |
4460 | MagnitudeDamage(HitboxR, 7, 10, 15, 50, "Normal", "610359590", 1) | |
4461 | for i = 0, 1, 0.1 do | |
4462 | swait() | |
4463 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 0.3) | |
4464 | PlayAnimationFromTable({ | |
4465 | CFrame.new(-0.338160992, -0.0772590488, -0.484170675, 0.307024002, -0.153706044, 0.939207554, -0.403236002, 0.872901201, 0.274671286, -0.86205399, -0.463052958, 0.206021816) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4466 | CFrame.new(-0.0502282679, 1.50051379, -0.0864891857, 0.502356887, -0.246090144, -0.828901231, -0.00520065427, 0.957766473, -0.287500501, 0.864644766, 0.148738697, 0.479860842) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4467 | CFrame.new(1.81698525, 1.20575511, -0.168038458, 0.0800605565, -0.859217465, 0.505307972, 0.457053572, -0.418860257, -0.784640014, 0.885828495, 0.293771386, 0.359173566) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4468 | CFrame.new(-1.66351938, 0.691055655, 0.203685582, 0.309526145, 0.793331623, -0.524231553, -0.937197804, 0.347743452, -0.0271089375, 0.160791725, 0.499699503, 0.851144433) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4469 | CFrame.new(0.971616864, -1.6145575, 0.096719563, 0.544056833, -0.203144252, -0.814085484, 0.51142931, 0.849463344, 0.129818588, 0.665161908, -0.486975014, 0.566052973) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4470 | CFrame.new(-0.676943898, -1.44413579, 0.206094518, 0.884253025, 0.0570309162, -0.463512957, 0.209485695, 0.838620007, 0.502824426, 0.417387724, -0.541723251, 0.729605079) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4471 | }, 0.6, false) | |
4472 | end | |
4473 | attack = false | |
4474 | end | |
4475 | function CastleCrusherFist() | |
4476 | attack = true | |
4477 | STDamage = true | |
4478 | local S2 = CFuncs.Sound.Create("", Torso, 1, 1) | |
4479 | for i = 0, 1, 0.1 do | |
4480 | swait() | |
4481 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1) | |
4482 | Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5) | |
4483 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.2) | |
4484 | PlayAnimationFromTable({ | |
4485 | CFrame.new(-5.99771738E-7, -0.00717129931, 0.169464022, 0.422617912, -2.2671E-7, -0.906308055, -0.309975952, 0.939692557, -0.144544229, 0.851650834, 0.342020661, 0.397130787) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4486 | CFrame.new(-0.0102166235, 1.52751005, -0.239579424, 0.456926107, -0.171424359, 0.872835577, -0.167732254, 0.94705075, 0.273807496, -0.87355268, -0.271512181, 0.403976858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4487 | CFrame.new(0.944673777, 0.474064022, -0.539126158, 0.229199454, 0.762564063, 0.604949772, 0.809601307, 0.195682317, -0.553402781, -0.540382624, 0.616607308, -0.572522938) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4488 | CFrame.new(-1.61232829, 0.309644789, -0.24482432, 0.455398798, 0.536860108, -0.710207343, -0.887026072, 0.205374956, -0.413530886, -0.076149486, 0.818293095, 0.569735885) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4489 | CFrame.new(1.08113468, -1.48232126, 0.656104684, 0.81421864, -0.517612338, 0.262917578, 0.175395042, 0.651024699, 0.738514543, -0.553430021, -0.555197835, 0.620862961) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4490 | CFrame.new(-0.427128136, -1.50760674, -0.0473105907, 0.804508269, -0.373179317, 0.462065101, -0.173640698, 0.596196175, 0.783836842, -0.567992628, -0.71083647, 0.414845526) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4491 | }, 0.2, false) | |
4492 | end | |
4493 | MagnitudeDamage(HitboxR, 10, 50, 80, 100, "Normal", "610359515", 1) | |
4494 | Effects.Wave.Create(BrickColor.new("Pastel blue-green"), RootPart.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.06) | |
4495 | CFuncs.Sound.Create("471881980", HitboxR, 1, 0.9) | |
4496 | CFuncs.Sound.Create("471881954", HitboxR, 1, 0.8) | |
4497 | for i = 0, 1, 0.08 do | |
4498 | swait() | |
4499 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1) | |
4500 | Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5) | |
4501 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 0.3) | |
4502 | PlayAnimationFromTable({ | |
4503 | CFrame.new(-3.57627869E-7, -0.116980031, -2.22140098, 0.342020035, -6.11579551E-8, 0.939692736, -0.604023039, 0.766044259, 0.219846413, -0.71984607, -0.642787933, 0.262002468) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4504 | CFrame.new(-1.13248825E-6, 1.49999046, 8.94069672E-7, 0.422608167, -0.383014679, -0.82140249, -1.36196613E-5, 0.906310022, -0.422613323, 0.906312764, 0.17861104, 0.383008778) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4505 | CFrame.new(1.72490048, 1.25688744, -0.021425128, -0.678134382, -0.731868863, 0.0670941696, 0.667953849, -0.575675249, 0.47163111, -0.306547582, 0.364645123, 0.879239857) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4506 | CFrame.new(-1.70565486, 0.469353855, 0.162862837, 0.82686162, 0.55728358, 0.0757693052, -0.414878726, 0.513436973, 0.751176, 0.379712611, -0.652546048, 0.655748963) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4507 | CFrame.new(0.757160306, -1.48393714, -0.193787217, 0.601814985, 0.305624545, -0.737842917, -2.98023224E-8, 0.923879623, 0.382683486, 0.798635662, -0.230304718, 0.556004763) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4508 | CFrame.new(-0.908789515, -1.60188651, -0.0663503706, 0.696367741, 0.548584938, -0.462741733, -0.173660636, 0.7544052, 0.633021533, 0.696362019, -0.360454619, 0.620610356) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4509 | }, 0.6, false) | |
4510 | end | |
4511 | STDamage = false | |
4512 | attack = false | |
4513 | end | |
4514 | function CastleCrusherFist() | |
4515 | attack = true | |
4516 | STDamage = true | |
4517 | local S2 = CFuncs.Sound.Create("", Torso, 1, 1) | |
4518 | for i = 0, 1, 0.1 do | |
4519 | swait() | |
4520 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1) | |
4521 | Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5) | |
4522 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.5) | |
4523 | PlayAnimationFromTable({ | |
4524 | CFrame.new(-5.99771738E-7, -0.00717129931, 0.169464022, 0.422617912, -2.2671E-7, -0.906308055, -0.309975952, 0.939692557, -0.144544229, 0.851650834, 0.342020661, 0.397130787) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4525 | CFrame.new(-0.0102166235, 1.52751005, -0.239579424, 0.456926107, -0.171424359, 0.872835577, -0.167732254, 0.94705075, 0.273807496, -0.87355268, -0.271512181, 0.403976858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4526 | CFrame.new(0.944673777, 0.474064022, -0.539126158, 0.229199454, 0.762564063, 0.604949772, 0.809601307, 0.195682317, -0.553402781, -0.540382624, 0.616607308, -0.572522938) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4527 | CFrame.new(-1.61232829, 0.309644789, -0.24482432, 0.455398798, 0.536860108, -0.710207343, -0.887026072, 0.205374956, -0.413530886, -0.076149486, 0.818293095, 0.569735885) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4528 | CFrame.new(1.08113468, -1.48232126, 0.656104684, 0.81421864, -0.517612338, 0.262917578, 0.175395042, 0.651024699, 0.738514543, -0.553430021, -0.555197835, 0.620862961) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4529 | CFrame.new(-0.427128136, -1.50760674, -0.0473105907, 0.804508269, -0.373179317, 0.462065101, -0.173640698, 0.596196175, 0.783836842, -0.567992628, -0.71083647, 0.414845526) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4530 | }, 0.2, false) | |
4531 | end | |
4532 | Effects.Wave.Create(BrickColor.new("Pastel blue-green"), RootPart.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.06) | |
4533 | Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 140 | |
4534 | CFuncs.Sound.Create("471881980", HitboxR, 1, 0.9) | |
4535 | CFuncs.Sound.Create("471881954", HitboxR, 1, 0.8) | |
4536 | for i = 0, 1, 0.08 do | |
4537 | swait() | |
4538 | MagnitudeDamage(HitboxR, 5, 50, 80, 100, "Normal", "610359515", 1) | |
4539 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 4, 4, 4, 0.3, 1) | |
4540 | Effects.Break.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 0.5, 0.5, 0.5) | |
4541 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -5), 1) | |
4542 | PlayAnimationFromTable({ | |
4543 | CFrame.new(-3.57627869E-7, -0.116980031, -2.22140098, 0.342020035, -6.11579551E-8, 0.939692736, -0.604023039, 0.766044259, 0.219846413, -0.71984607, -0.642787933, 0.262002468) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4544 | CFrame.new(-1.13248825E-6, 1.49999046, 8.94069672E-7, 0.422608167, -0.383014679, -0.82140249, -1.36196613E-5, 0.906310022, -0.422613323, 0.906312764, 0.17861104, 0.383008778) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4545 | CFrame.new(1.72490048, 1.25688744, -0.021425128, -0.678134382, -0.731868863, 0.0670941696, 0.667953849, -0.575675249, 0.47163111, -0.306547582, 0.364645123, 0.879239857) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4546 | CFrame.new(-1.70565486, 0.469353855, 0.162862837, 0.82686162, 0.55728358, 0.0757693052, -0.414878726, 0.513436973, 0.751176, 0.379712611, -0.652546048, 0.655748963) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4547 | CFrame.new(0.757160306, -1.48393714, -0.193787217, 0.601814985, 0.305624545, -0.737842917, -2.98023224E-8, 0.923879623, 0.382683486, 0.798635662, -0.230304718, 0.556004763) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4548 | CFrame.new(-0.908789515, -1.60188651, -0.0663503706, 0.696367741, 0.548584938, -0.462741733, -0.173660636, 0.7544052, 0.633021533, 0.696362019, -0.360454619, 0.620610356) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4549 | }, 0.6, false) | |
4550 | end | |
4551 | STDamage = false | |
4552 | attack = false | |
4553 | end | |
4554 | ||
4555 | ||
4556 | distance2__=0 | |
4557 | AdvancingFortress.FHead.face:remove() | |
4558 | ||
4559 | function Lattack() | |
4560 | attack = true | |
4561 | local S = CFuncs.Sound.Create("", Torso, 3, 1) | |
4562 | S.Looped = true | |
4563 | if Long then | |
4564 | while Long and distance2__>-15 do-- max range | |
4565 | distance2__=distance2__-1 | |
4566 | ||
4567 | for i = 0, 1, 0.8 do | |
4568 | swait() | |
4569 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, distance2__), 0.5) | |
4570 | PlayAnimationFromTable({ | |
4571 | CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4572 | CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4573 | CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4574 | CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4575 | CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4576 | CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4577 | }, 0.8, false) | |
4578 | end | |
4579 | ||
4580 | end | |
4581 | for i = 0, 1, 0.8 do | |
4582 | swait() | |
4583 | PlayAnimationFromTable({ | |
4584 | CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, -1, 0), | |
4585 | CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4586 | CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4587 | CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4588 | CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4589 | CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4590 | }, 0.8, false) | |
4591 | end | |
4592 | CFuncs.Sound.Create("200632136", HitboxL, 0.3, math.random(1, 1.2)) | |
4593 | MagnitudeDamage(HitboxL, 5, 4, 50, 0, "Normal", "260430117", 1) | |
4594 | PlayAnimationFromTable({ | |
4595 | CFrame.new(-0.561874092, -0.346845925, -0.435822666, 0.64278698, -0.323744029, 0.694272816, 0, 0.906308115, 0.422617555, -0.766044974, -0.271653026, 0.582563102) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 1, 0), | |
4596 | CFrame.new(8.9481473E-6, 1.49999249, 5.2684918E-6, 0.704669476, 0.0560214818, -0.707321048, -0.0868221819, 0.996195257, -0.0075956285, 0.704204142, 0.0667634308, 0.706852198) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4597 | CFrame.new(1.97048378, 0.808467984, -0.254994273, -0.457079947, -0.7819345, 0.423859, 0.842444837, -0.227779076, 0.488266319, -0.285246044, 0.580254436, 0.762849629) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4598 | CFrame.new(-1.18535733, 0.530705392, -0.713678956, 0.778861284, -0.400152355, 0.482962847, 0.492400557, -0.0868335962, -0.866026342, 0.388479888, 0.912325621, 0.129403993) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4599 | CFrame.new(0.708622813, -1.45549953, -0.199998885, 0.984808087, -0.167729571, -0.0449446738, 0.173646823, 0.951251328, 0.254887581, 1.4603138E-6, -0.258819878, 0.965925694) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4600 | CFrame.new(-0.604502141, -1.943735, 5.15520573E-4, 0.982544005, 0.00845471025, 0.185841322, -0.0717865527, 0.938827574, 0.336824685, -0.17162481, -0.34428525, 0.923045695) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4601 | }, 0.8, false) | |
4602 | end | |
4603 | wait(1) | |
4604 | distance2__=0 | |
4605 | STDamage = false | |
4606 | attack = false | |
4607 | end | |
4608 | ||
4609 | ||
4610 | ||
4611 | ||
4612 | function weld5(part0, part1, c0, c1) | |
4613 | local weeld = Instance.new("Weld", part0) | |
4614 | weeld.Part0 = part0 | |
4615 | weeld.Part1 = part1 | |
4616 | weeld.C0 = c0 | |
4617 | weeld.C1 = c1 | |
4618 | return weeld | |
4619 | end | |
4620 | local Grab = false | |
4621 | function GRABEMBOIGRABEM() | |
4622 | attack = true | |
4623 | gp = nil | |
4624 | con1 = HitboxR.Touched:connect(function(hit) | |
4625 | local ht = hit.Parent | |
4626 | local hum1 = ht:FindFirstChild("Humanoid") | |
4627 | if Grab == false then | |
4628 | if hum1 ~= nil and hit.Parent ~= Character then | |
4629 | hum1.PlatformStand = true | |
4630 | gp = ht | |
4631 | Grab = true | |
4632 | local asd = weld5(RightArm, ht:FindFirstChild("Torso"), CFrame.new(0, -1.5, 0), CFrame.new(0, 0, 0)) | |
4633 | asd.Parent = RightArm | |
4634 | asd.Name = "asd" | |
4635 | asd.C0 = asd.C0 * CFrame.Angles(math.rad(-90), 0, 0) | |
4636 | CFuncs.Sound.Create("200632821", Torso, 1, 1) | |
4637 | elseif hum1 == nil then | |
4638 | con1:disconnect() | |
4639 | wait() | |
4640 | return | |
4641 | end | |
4642 | end | |
4643 | end) | |
4644 | for i = 0, 1, 0.2 do | |
4645 | swait() | |
4646 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2), 0.3) | |
4647 | PlayAnimationFromTable({ | |
4648 | CFrame.new(-1.08022243E-4, -0.233785003, -0.0873367637, 0.499999821, -1.78813863E-7, -0.866025507, 0.150383934, 0.984807789, 0.0868239477, 0.852868676, -0.173648283, 0.492403716) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4649 | CFrame.new(-1.2665987E-7, 1.49999368, -1.02072954E-6, 0.573575675, 0.0713936985, 0.816035628, -5.01982868E-7, 0.996194899, -0.0871551931, -0.819152594, 0.049989678, 0.571393132) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4650 | CFrame.new(1.47017705, 0.884583473, 0.0280318335, 0.886720777, -0.205462068, 0.414139926, 0.236241817, -0.568640172, -0.787933052, 0.397386849, 0.796513736, -0.455686152) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4651 | CFrame.new(-1.76647317, 0.409804255, -0.03838256, 0.444113791, 0.836516619, -0.320940912, -0.836516619, 0.258818626, -0.482962757, -0.320940822, 0.482962757, 0.814704895) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4652 | CFrame.new(0.838749349, -1.98392951, 0.15807499, 0.830397308, -0.277826965, 0.48296237, 0.167731524, 0.951251447, 0.258818328, -0.53132534, -0.133914024, 0.836516857) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4653 | CFrame.new(-0.811016142, -1.63281643, -0.179561377, 0.642214835, 0.00870995224, 0.76647532, -0.0151349902, 0.999884725, 0.00131897628, -0.766375303, -0.0124476701, 0.642272472) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4654 | }, 0.3, false) | |
4655 | end | |
4656 | for i = 0, 1, 0.1 do | |
4657 | swait() | |
4658 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -6), 0.3) | |
4659 | PlayAnimationFromTable({ | |
4660 | CFrame.new(0.159273595, -0.292363107, -0.115490548, 0.0844330043, -0.144068986, 0.985959053, -0.357129037, 0.919379771, 0.164923266, -0.930231094, -0.366039604, 0.0261747837) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4661 | CFrame.new(4.81307507E-6, 1.49999106, -3.65450978E-6, 0.171444774, -0.100317284, -0.980072975, -0.0616287738, 0.991762042, -0.11229457, 0.983264267, 0.0796530023, 0.163850009) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4662 | CFrame.new(1.73932612, 1.06159639, 0.141945362, -0.153680667, -0.913934886, 0.375639945, 0.659919798, -0.377877831, -0.649395287, 0.735450923, 0.148092732, 0.661196351) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4663 | CFrame.new(-1.68730593, 0.429691374, -0.418232322, 0.633863091, 0.519853055, -0.57268703, -0.772902489, 0.453472316, -0.443829596, 0.028971523, 0.723958433, 0.689235032) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4664 | CFrame.new(0.51381135, -1.74729896, 0.0663300753, 0.422899842, 0.615153313, -0.665388703, -0.0435856879, 0.747240186, 0.66312325, 0.905127704, -0.251433372, 0.342819571) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4665 | CFrame.new(-0.991570175, -1.5009346, -0.1830419, 0.415304065, 0.586875141, -0.695054054, -0.166150108, 0.800146103, 0.576333642, 0.894380629, -0.123870395, 0.429813296) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4666 | }, 0.3, false) | |
4667 | end | |
4668 | if Grab == true then | |
4669 | for i = 1, 5 do | |
4670 | for i = 0, 1, 0.35 do | |
4671 | swait() | |
4672 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 13, -6), 0.3) | |
4673 | PlayAnimationFromTable({ | |
4674 | CFrame.new(-0.0701122433, -0.336599797, -0.467321932, 0.694850504, -0.140219957, -0.70535183, 0.704946458, 0.326802045, 0.629484713, 0.142244101, -0.934633017, 0.325926095) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4675 | CFrame.new(-3.05473804E-6, 1.49998987, 8.94069672E-7, 0.707109332, 0.122785509, 0.696362555, 1.49011612E-6, 0.984807491, -0.173649877, -0.707104206, 0.122789055, 0.696367502) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4676 | CFrame.new(1.23286271, 0.549701929, -0.640782475, 0.740093768, 0.612683415, 0.277277708, 0.0735714883, 0.336068332, -0.938959956, -0.668469429, 0.715318501, 0.203645304) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4677 | CFrame.new(-1.63418663, 0.202915072, -0.0286649466, 0.865367413, 0.490698665, 0.101754986, -0.445756227, 0.846484005, -0.291146517, -0.228999093, 0.206590697, 0.951251805) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4678 | CFrame.new(0.702593744, -1.71321297, 0.369734973, 0.965928972, -0.148447216, 0.212003857, 1.10641122E-6, 0.819153726, 0.573574424, -0.258809477, -0.554031372, 0.791244447) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4679 | CFrame.new(-0.577289343, -1.34221494, -0.247686923, 0.766049445, -0.219846189, 0.604016602, 1.58697367E-6, 0.939692199, 0.342021465, -0.642781496, -0.262004316, 0.719851196) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4680 | }, 0.4, false) | |
4681 | end | |
4682 | for i = 0, 1, 0.3 do | |
4683 | swait() | |
4684 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -6), 0.3) | |
4685 | PlayAnimationFromTable({ | |
4686 | CFrame.new(-0.170705646, -0.774955988, -0.472947001, 0.827218175, 0.130671635, 0.546475112, -0.561879098, 0.194839522, 0.803946257, -0.00142200035, -0.972091854, 0.234596446) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4687 | CFrame.new(-1.76951289E-7, 1.49999058, 2.2649765E-6, 0.80180192, -0.161171481, -0.575445414, 0.176131338, 0.983905077, -0.0301590711, 0.571044207, -0.0771723837, 0.817283988) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4688 | CFrame.new(1.59014189, 0.537312388, -0.263691217, 0.798337102, -0.524361372, 0.296147287, 0.455999702, 0.205153137, -0.866011977, 0.393347621, 0.826412499, 0.402889967) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4689 | CFrame.new(-1.41546631, 0.414666086, 0.337005794, 0.716736436, 0.581529975, 0.384852976, -0.56681174, 0.807305396, -0.164264664, -0.406218559, -0.100404784, 0.908243656) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4690 | CFrame.new(0.793360233, -1.59947133, 0.0620805621, 0.876221955, -0.148448378, -0.458477885, 0.368687749, 0.81915307, 0.439383447, 0.310339272, -0.55403173, 0.772486985) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4691 | CFrame.new(-0.535338402, -1.81867206, 0.817932665, 0.829598367, 0.11430642, -0.546535134, 0.32139504, 0.702652454, 0.634810925, 0.456587166, -0.702291727, 0.546181798) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4692 | }, 0.7, false) | |
4693 | end | |
4694 | local hit, pos = rayCast(HitboxR.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 100, Character) | |
4695 | if hit ~= nil then | |
4696 | MagnitudeDamage(HitboxR, 5, 10, 30, 0, "Normal", "610359515", 1.3) | |
4697 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 1, 1, 1, 0.7, 0.7, 0.7, 0.09, 1) | |
4698 | Effects.Wave.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 1, 1, 1, 0.7, 0.7, 0.7, 0.09) | |
4699 | Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), CFrame.new(pos), 3, 3, 3, 5, 5, 5, 0.09) | |
4700 | end | |
4701 | end | |
4702 | end | |
4703 | for i, v in pairs(RightArm:GetChildren()) do | |
4704 | if v.Name == "asd" and v:IsA("Weld") then | |
4705 | v:Remove() | |
4706 | end | |
4707 | end | |
4708 | Grab = false | |
4709 | con1:disconnect() | |
4710 | attack = false | |
4711 | end | |
4712 | local IsWearingArmor = false | |
4713 | function Armor(Mode) | |
4714 | attack = true | |
4715 | if IsWearingArmor == false and Mode == "On" then | |
4716 | IsWearingArmor = true | |
4717 | Disappear() | |
4718 | swait(10) | |
4719 | ReappearArmorOnly() | |
4720 | Character.Humanoid.MaxHealth = 500 | |
4721 | Character.Humanoid.Health = 500 | |
4722 | AHandleRWeld.Part0 = Character["Right Arm"] | |
4723 | AHandleLWeld.Part0 = Character["Left Arm"] | |
4724 | for i, v in pairs(AdvancingFortress:GetChildren()) do | |
4725 | if v:IsA("BasePart") then | |
4726 | v.Transparency = 1 | |
4727 | end | |
4728 | end | |
4729 | for i, v in pairs(Character:GetChildren()) do | |
4730 | if v:IsA("Accessory") then | |
4731 | v.Handle.Transparency = 1 | |
4732 | end | |
4733 | end | |
4734 | elseif IsWearingArmor == true and Mode == "Off" then | |
4735 | IsWearingArmor = false | |
4736 | DisappearArmorOnly() | |
4737 | for i, v in pairs(Character:GetChildren()) do | |
4738 | if v:IsA("Accessory") then | |
4739 | v.Handle.Transparency = 0 | |
4740 | end | |
4741 | end | |
4742 | swait(10) | |
4743 | Reappear() | |
4744 | Character.Humanoid.MaxHealth = 100 | |
4745 | Character.Humanoid.Health = 100 | |
4746 | ||
4747 | AHandleRWeld.Part0 = RightArm | |
4748 | AHandleLWeld.Part0 = LeftArm | |
4749 | ||
4750 | for i, v in pairs(AdvancingFortress:GetChildren()) do | |
4751 | if v:IsA("BasePart") then | |
4752 | v.Transparency = 0 | |
4753 | end | |
4754 | end | |
4755 | end | |
4756 | attack = false | |
4757 | end | |
4758 | local ShieldMode = false | |
4759 | local ShieldCharge = false | |
4760 | function HoloHexShield() | |
4761 | attack = true | |
4762 | Shield.Parent = m | |
4763 | Shield.CanCollide = true | |
4764 | if ShieldMode == true then | |
4765 | while ShieldMode == true do | |
4766 | swait() | |
4767 | Effects.Elec.Create(Shield.CFrame, 6, 6, 6) | |
4768 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3) | |
4769 | PlayAnimationFromTable({ | |
4770 | CFrame.new(-1.35600567E-6, -0.00759640103, -0.0868249983, 0.499999046, -1.78813579E-7, -0.866026044, 0.150384009, 0.984807789, 0.0868238211, 0.852869093, -0.173648283, 0.492402941) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4771 | CFrame.new(1.49011612E-7, 1.4999963, -2.08616257E-7, 0.499999046, 0.0754797831, 0.862731695, -1.78813579E-7, 0.996196151, -0.0871563852, -0.866026044, 0.0435779616, 0.498097092) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4772 | CFrame.new(1.50238657, 0.320674658, 0.252193451, 0.855209947, -0.376432747, -0.356249839, 0.469514668, 0.853786647, 0.224954769, 0.219480619, -0.35964793, 0.906907678) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4773 | CFrame.new(-0.944740474, 0.689363539, -0.718644142, 0.836517215, -0.545084715, 0.0558781698, -0.258834839, -0.482974619, -0.836504936, 0.482953727, 0.685287297, -0.545103252) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4774 | CFrame.new(0.61525929, -1.85127568, 0.120779425, 0.928754449, -0.162676111, 0.333104134, 0.0394990072, 0.93689239, 0.347407103, -0.368597984, -0.309496939, 0.876555264) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4775 | CFrame.new(-0.849455297, -1.60697818, -0.270956695, 0.696359396, -0.136922374, 0.704511464, -0.122786656, 0.944430828, 0.30491665, -0.707112312, -0.298836082, 0.640850842) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4776 | }, 0.3, false) | |
4777 | end | |
4778 | end | |
4779 | Shield.CanCollide = false | |
4780 | CFuncs.Sound.Create("200632211", HitboxR, 1, 0.8) | |
4781 | CFuncs.Sound.Create("200632875", HitboxR, 1, 0.9) | |
4782 | Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 160 | |
4783 | Effects.Wave.Create(BrickColor.new("Pastel blue-green"), RootPart.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.06) | |
4784 | for i = 0, 1, 0.05 do | |
4785 | swait() | |
4786 | MagnitudeDamage(Shield, 5, 10, 15, 20, "Normal", "610359515", 1.3) | |
4787 | Effects.Elec.Create(Shield.CFrame, 6, 6, 6) | |
4788 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -3), 1) | |
4789 | PlayAnimationFromTable({ | |
4790 | CFrame.new(8.64267349E-7, -0.183445007, -0.748600185, 0.499999046, -1.19209105E-7, -0.866026044, 0.496732056, 0.819152176, 0.28678751, 0.709407032, -0.573576331, 0.409575343) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4791 | CFrame.new(-7.15255737E-7, 1.50001967, -6.2584877E-7, 0.499999046, 0.36600244, 0.784893453, -1.19209105E-7, 0.90631634, -0.42262283, -0.866026044, 0.211310923, 0.453157306) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4792 | CFrame.new(1.76569033, 0.610707581, 0.171269983, 0.658267856, -0.680293143, -0.322312057, 0.725086272, 0.457917482, 0.514355659, -0.202320263, -0.572288036, 0.794703186) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4793 | CFrame.new(-1.07552779, 1.01543474, -0.975205183, 0.645357251, -0.653341353, -0.39580214, -0.64124006, -0.181770697, -0.745500326, 0.4151209, 0.734918237, -0.536255598) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4794 | CFrame.new(0.630614281, -1.76328135, 0.440194428, 0.866077662, -0.24334389, 0.436684549, -0.0614839792, 0.815044224, 0.57612747, -0.496114343, -0.525820255, 0.69092983) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4795 | CFrame.new(-0.857700765, -1.25810766, -0.239681423, 0.499215126, -0.257185757, 0.827429712, -0.238765404, 0.877132356, 0.416689515, -0.832931936, -0.405579239, 0.376470625) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4796 | }, 0.5, false) | |
4797 | end | |
4798 | Shield.Parent = nil | |
4799 | attack = false | |
4800 | end | |
4801 | Mouse.Button1Down:connect(function() | |
4802 | if attack == false and attacktype == 1 then | |
4803 | attacktype = 2 | |
4804 | attackone() | |
4805 | elseif attack == false and attacktype == 2 then | |
4806 | attacktype = 1 | |
4807 | attacktwo() | |
4808 | end | |
4809 | end) | |
4810 | game.Lighting.Outlines = false | |
4811 | function attackone() | |
4812 | attack = true | |
4813 | for i = 0, 1, 0.12 do | |
4814 | swait() | |
4815 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3) | |
4816 | PlayAnimationFromTable({ | |
4817 | CFrame.new(1.51857734E-4, -0.310488015, -0.087417841, 0.707106054, 5.26835073E-8, -0.707107484, 0.122787014, 0.984807968, 0.122786865, 0.696365058, -0.173646957, 0.696363688) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4818 | CFrame.new(0.101928703, 1.50244772, -0.0383823365, 0.76589334, 0.0762532279, 0.638430059, -0.0196644422, 0.995256186, -0.095281601, -0.642666996, 0.0604211651, 0.763759375) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4819 | CFrame.new(1.01774633, 0.557527065, -0.776187301, 0.541353703, 0.741649806, 0.396095604, 0.711713314, -0.153383806, -0.685520053, -0.447661191, 0.653015316, -0.610876858) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4820 | CFrame.new(-1.07208586, 0.264054269, -0.716768324, 0.529938459, -0.260122895, -0.807156265, -0.752277017, 0.295165181, -0.589030504, 0.39146477, 0.919355154, -0.039265126) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4821 | CFrame.new(0.81415844, -1.89738977, 0.144144416, 0.866025925, -0.171008825, 0.469845951, -1.40815973E-6, 0.939692497, 0.342020512, -0.499999285, -0.296199232, 0.813797772) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4822 | CFrame.new(-0.818738878, -1.59999573, -0.397991776, 0.642786622, 0.0667650178, 0.763130188, 4.3399632E-7, 0.99619472, -0.0871558338, -0.766045213, 0.0560229495, 0.640340626) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4823 | }, 0.3, false) | |
4824 | end | |
4825 | MagnitudeDamage(HitboxR, 7, 10, 15, math.random(1, 3), "Normal", "260430079", 1) | |
4826 | CFuncs.Sound.Create("200632136", HitboxR, 1, 1) | |
4827 | RootPart.Velocity = RootPart.CFrame.lookVector * 40 | |
4828 | for i = 0, 1, 0.11 do | |
4829 | swait() | |
4830 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3) | |
4831 | PlayAnimationFromTable({ | |
4832 | CFrame.new(0.31380862, -0.320521832, 0.0252371654, 0.249517962, -0.150383011, 0.956622124, -0.0458769947, 0.984923244, 0.166798219, -0.967282891, -0.0855060965, 0.238856897) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4833 | CFrame.new(0.101926193, 1.50244832, -0.0383800864, 0.337979913, 0.0762555003, -0.938059092, -0.0828148723, 0.995255768, 0.051067099, 0.937502801, 0.0604255944, 0.342691481) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4834 | CFrame.new(1.96121001, 0.774859428, -0.462411612, 0.340120375, -0.92077136, 0.191045195, 0.466549307, -0.0111669078, -0.884424806, 0.816486418, 0.389942825, 0.42578721) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4835 | CFrame.new(-1.36170578, 0.526111126, -0.597925961, 0.81348151, -0.212761745, -0.541276693, -0.539894938, 0.0697831511, -0.838834763, 0.216243982, 0.974609077, -0.0581016839) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4836 | CFrame.new(0.970680714, -1.68610644, -0.0975568295, 0.579166114, -0.127570763, -0.805166125, 0.110368893, 0.990856647, -0.0776019096, 0.807703912, -0.0439208932, 0.587950349) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4837 | CFrame.new(-0.827146292, -1.8113209, -0.0556658059, 0.816036701, 0.217413262, -0.535551846, -0.0871567726, 0.962250471, 0.257832885, 0.571391284, -0.163724124, 0.804180741) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4838 | }, 0.45, false) | |
4839 | end | |
4840 | attack = false | |
4841 | end | |
4842 | function attacktwo() | |
4843 | attack = true | |
4844 | for i = 0, 1, 0.12 do | |
4845 | swait() | |
4846 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3) | |
4847 | PlayAnimationFromTable({ | |
4848 | CFrame.new(-0.0382043272, -0.447743475, -0.209081307, 0.653245032, -0.0733856931, 0.753581822, -0.271655023, 0.906307638, 0.323743671, -0.706735075, -0.416198224, 0.572105408) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4849 | CFrame.new(-2.74181366E-6, 1.49999321, -3.4570694E-6, 0.707105815, -0.183012873, -0.683013678, -8.7171793E-7, 0.965925694, -0.258819759, 0.707107782, 0.183013588, 0.683011472) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4850 | CFrame.new(1.65075588, 0.743636727, -0.356577665, 0.542998552, -0.115416825, 0.831764221, 0.839699984, 0.0834951103, -0.536593378, -0.00751632452, 0.989801884, 0.142253295) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4851 | CFrame.new(-1.08620656, -0.00580590963, -0.864283919, 0.656464815, -0.698875248, 0.283949524, 0.478162557, 0.0943745971, -0.873186052, 0.583450615, 0.708990037, 0.396129608) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4852 | CFrame.new(0.856426239, -1.40340364, -0.356423855, 0.707105279, -0.122788861, -0.696365654, 9.42498446E-7, 0.98480767, -0.173648372, 0.707108438, 0.122787014, 0.696362913) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4853 | CFrame.new(-0.695387185, -1.90375674, -0.304245114, 0.92541647, 0.246137589, -0.288133472, -0.173648298, 0.951251149, 0.254887551, 0.336824656, -0.185843274, 0.923044682) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4854 | }, 0.34, false) | |
4855 | end | |
4856 | MagnitudeDamage(HitboxL, 7, 10, 15, math.random(1, 3), "Normal", "260430079", 1.1) | |
4857 | CFuncs.Sound.Create("200632136", HitboxL, 1, 1) | |
4858 | RootPart.Velocity = RootPart.CFrame.lookVector * 40 | |
4859 | for i = 0, 1, 0.12 do | |
4860 | swait() | |
4861 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(0, 1.3, -4), 0.3) | |
4862 | PlayAnimationFromTable({ | |
4863 | CFrame.new(-0.479634404, -0.393727064, -0.220339894, 0.248309121, 0.219825819, -0.94340837, 0.019257009, 0.972597659, 0.231695861, 0.968489468, -0.0756994039, 0.237271711) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4864 | CFrame.new(-4.01586294E-6, 1.4999907, -1.59628689E-6, 0.237956509, -0.0991817266, 0.966198623, 0.22414881, 0.973527908, 0.0447304621, -0.945057809, 0.205928385, 0.253888786) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4865 | CFrame.new(1.08192515, 0.657660127, -1.1749661, 0.228772208, 0.493058115, 0.839379132, 0.874719322, 0.27430138, -0.399530977, -0.427234828, 0.825622678, -0.368534833) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4866 | CFrame.new(-1.23054802, 1.29996836, -0.754827142, 0.94838953, -0.316170156, 0.0243683457, -0.269034386, -0.84291333, -0.465958893, 0.167862713, 0.43535465, -0.88447094) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4867 | CFrame.new(0.839919031, -1.81287205, 0.0102108568, 0.808574855, -0.267538428, 0.524051666, 0.171010748, 0.95905602, 0.22575888, -0.562994003, -0.0929245204, 0.821220458) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4868 | CFrame.new(-0.846072078, -1.7213496, -0.247524291, 0.693717241, 0.0689389557, 0.716940701, -0.0478171073, 0.997620881, -0.0496601462, -0.718658566, 1.68083934E-4, 0.695363283) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4869 | }, 0.45, false) | |
4870 | end | |
4871 | attack = false | |
4872 | end | |
4873 | function findNearestTorso(pos) | |
4874 | local list = game.Workspace:children() | |
4875 | local torso | |
4876 | local dist = 1000 | |
4877 | local temp, human, temp2 | |
4878 | for x = 1, #list do | |
4879 | temp2 = list[x] | |
4880 | if temp2.className == "Model" and temp2.Name ~= Character.Name then | |
4881 | temp = temp2:findFirstChild("Torso") | |
4882 | human = temp2:findFirstChild("Humanoid") | |
4883 | if temp ~= nil and human ~= nil and human.Health > 0 and dist > (temp.Position - pos).magnitude then | |
4884 | local dohit = true | |
4885 | if dohit == true then | |
4886 | torso = temp | |
4887 | dist = (temp.Position - pos).magnitude | |
4888 | end | |
4889 | end | |
4890 | end | |
4891 | end | |
4892 | return torso, dist | |
4893 | end | |
4894 | function TrueAim(aim) | |
4895 | local target, distance = findNearestTorso(Mouse.Hit.p) | |
4896 | local tehcf = HitboxR.CFrame * CFrame.fromEulerAnglesXYZ(1.57, 0, 0).lookVector | |
4897 | if aim ~= nil then | |
4898 | tehcf = aim | |
4899 | end | |
4900 | table.insert(Effects, { | |
4901 | tehcf, | |
4902 | "Shoot", | |
4903 | 30, | |
4904 | HitboxR.Position, | |
4905 | 10, | |
4906 | 15, | |
4907 | 0, | |
4908 | 3, | |
4909 | HitboxR, | |
4910 | target | |
4911 | }) | |
4912 | end | |
4913 | function FireProjectiles() | |
4914 | attack = true | |
4915 | Humanoid.WalkSpeed = 20 | |
4916 | CFuncs.Sound.Create("300915902", HitboxR, 1, 0.8) | |
4917 | for i = 0, 1, 0.1 do | |
4918 | swait() | |
4919 | Effects.Elec.Create(HitboxR.CFrame, 2, 2, 2) | |
4920 | PlayAnimationFromTable({ | |
4921 | CFrame.new(0, -0.100000001, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4922 | CFrame.new(0, 1.49999201, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4923 | CFrame.new(0.874554753, 1.14087927, -1.06730831, -0.166365892, 0.198266983, 0.965925813, 0.797995508, -0.548363924, 0.250000268, 0.579245627, 0.812396049, -0.0669871047) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4924 | CFrame.new(-0.257126778, 1.24225974, -0.962940335, 0.692363203, -0.593008757, -0.411064416, -0.708803177, -0.665577948, -0.233675212, -0.135024026, 0.453151852, -0.88114804) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4925 | CFrame.new(0.604643881, -1.9909004, 0.0280392915, 0.962250233, -0.0841861367, -0.258818984, 0.0871560201, 0.996194661, 4.23252061E-7, 0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4926 | CFrame.new(-0.604644895, -1.99090064, 0.0280393362, 0.962250233, 0.0841861367, 0.258818984, -0.0871560201, 0.996194661, 4.23252061E-7, -0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4927 | }, 0.3, false) | |
4928 | end | |
4929 | for i = 0, 1, 0.1 do | |
4930 | swait() | |
4931 | Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3) | |
4932 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1) | |
4933 | Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1) | |
4934 | PlayAnimationFromTable({ | |
4935 | CFrame.new(0, -0.100000001, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4936 | CFrame.new(0, 1.49999201, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4937 | CFrame.new(0.661153734, 0.568759024, -0.827975571, -0.166752055, 0.025078943, 0.985679924, 0.98324734, -0.0704026297, 0.168131784, 0.0736110285, 0.99720335, -0.012919019) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4938 | CFrame.new(-0.390097797, 0.861622274, -0.554995477, 0.351840883, -0.837056041, -0.418981194, -0.935129642, -0.294365793, -0.197183579, 0.0417199843, 0.461178988, -0.886325777) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4939 | CFrame.new(0.604644954, -1.9909004, 0.0280390829, 0.962250233, -0.0841861367, -0.258818984, 0.0871560201, 0.996194661, 4.23252061E-7, 0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4940 | CFrame.new(-0.604644775, -1.99090064, 0.0280380547, 0.962250233, 0.0841861367, 0.258818984, -0.0871560201, 0.996194661, 4.23252061E-7, -0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4941 | }, 0.2, false) | |
4942 | end | |
4943 | for i = 1, 10 do | |
4944 | for i = 0, 1, 0.3 do | |
4945 | swait() | |
4946 | Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3) | |
4947 | Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1) | |
4948 | PlayAnimationFromTable({ | |
4949 | CFrame.new(0, -0.100000001, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4950 | CFrame.new(0, 1.49999201, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4951 | CFrame.new(0.661153734, 0.568759024, -0.827975571, -0.166752055, 0.025078943, 0.985679924, 0.98324734, -0.0704026297, 0.168131784, 0.0736110285, 0.99720335, -0.012919019) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4952 | CFrame.new(-0.390097797, 0.861622274, -0.554995477, 0.351840883, -0.837056041, -0.418981194, -0.935129642, -0.294365793, -0.197183579, 0.0417199843, 0.461178988, -0.886325777) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4953 | CFrame.new(0.604644954, -1.9909004, 0.0280390829, 0.962250233, -0.0841861367, -0.258818984, 0.0871560201, 0.996194661, 4.23252061E-7, 0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4954 | CFrame.new(-0.604644775, -1.99090064, 0.0280380547, 0.962250233, 0.0841861367, 0.258818984, -0.0871560201, 0.996194661, 4.23252061E-7, -0.257834047, -0.0225580372, 0.965925872) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4955 | }, 0.3, false) | |
4956 | end | |
4957 | CFuncs.Sound.Create("300916105", HitboxR, 1, 1.2) | |
4958 | CFuncs.Sound.Create("300916014", HitboxR, 1, 1) | |
4959 | Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 2, 2, 2, 0.07) | |
4960 | local MouseLook = CFrame.new((HitboxR.Position + Mouse.Hit.p) / 2, Mouse.Hit.p) | |
4961 | TrueAim(MouseLook.lookVector) | |
4962 | for i = 0, 1, 0.3 do | |
4963 | swait() | |
4964 | Effects.Elec.Create(HitboxR.CFrame, 3, 3, 3) | |
4965 | Effects.Sphere2.Create(BrickColor.new("Pastel blue-green"), HitboxR.CFrame, 1, 1, 1, 1, 1, 1, 0.1) | |
4966 | PlayAnimationFromTable({ | |
4967 | CFrame.new(1.90734863E-6, -0.25291419, 0.238341585, 1, 0, 0, 0, 0.996194661, -0.087155968, 0, 0.087155968, 0.996194661) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4968 | CFrame.new(0, 1.49999189, -1.1920929E-6, 1, 0, 0, 0, 0.98480767, 0.173648626, 0, -0.173648626, 0.98480767) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4969 | CFrame.new(0.689965963, 0.767623663, -0.856841147, -0.544456005, 0.160545677, 0.823281765, 0.798456132, -0.201499581, 0.567332089, 0.256973624, 0.966241658, -0.0184810348) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4970 | CFrame.new(-0.392649293, 0.920519292, -0.977094412, 0.403439909, -0.887421727, -0.222977459, -0.91384387, -0.378501445, -0.147058249, 0.0461054072, 0.263095737, -0.963667512) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4971 | CFrame.new(0.598512471, -1.89166105, 0.0173719227, 0.962250233, -0.061308533, -0.265171409, 0.0871564373, 0.992403805, 0.0868248865, 0.257834017, -0.106658652, 0.960284173) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
4972 | CFrame.new(-0.598512232, -1.89166129, 0.0173728764, 0.962250233, 0.061308533, 0.265171409, -0.0871564373, 0.992403805, 0.0868248865, -0.257834017, -0.106658652, 0.960284173) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) | |
4973 | }, 0.3, false) | |
4974 | end | |
4975 | end | |
4976 | Humanoid.WalkSpeed = 20 | |
4977 | attack = false | |
4978 | end | |
4979 | SHRA=false | |
4980 | ||
4981 | Check=false | |
4982 | dimension=workspace | |
4983 | Mouse.KeyUp:connect(function(k) | |
4984 | if k=='e' then | |
4985 | Long=false | |
4986 | end | |
4987 | end) | |
4988 | reload2=false | |
4989 | hand=true -- collect hands | |
4990 | Mouse.KeyDown:connect(function(k) | |
4991 | k = k:lower() | |
4992 | if k=='r' and dimension==workspace then | |
4993 | Meg=Instance.new('Part') | |
4994 | Meg.Parent=Character | |
4995 | Meg.CFrame=Mouse.Hit | |
4996 | Meg.Transparency=1 | |
4997 | Meg.CanCollide=false | |
4998 | Meg.Touched:connect(function(h) | |
4999 | if h.Parent~=Character or h.Parent~=workspace or h.Parent~=AdvancingFortress then | |
5000 | if h.Parent:findFirstChild('Torso')~=nil and h.Parent:findFirstChild('Humanoid')~=nil then | |
5001 | enem=h.Parent | |
5002 | ||
5003 | end | |
5004 | end | |
5005 | end) | |
5006 | wait(.1) | |
5007 | if enem~=nil then | |
5008 | eclone(enem.Torso) | |
5009 | ||
5010 | end | |
5011 | elseif k=='t' then | |
5012 | if dimension==workspace then | |
5013 | dimension=workspace.CurrentCamera | |
5014 | workspace.CurrentCamera.FieldOfView=180 | |
5015 | elseif dimension==workspace.CurrentCamera then | |
5016 | dimension=workspace | |
5017 | workspace.CurrentCamera.FieldOfView=70 | |
5018 | end | |
5019 | Character.Parent=dimension | |
5020 | elseif k=='y' then | |
5021 | if YOURCLONE~=nil then | |
5022 | Sav=YOURCLONE.Torso.CFrame | |
5023 | Sav2=YOURCLONE.Humanoid.Health | |
5024 | YOURCLONE.Torso.CFrame=Character.Torso.CFrame | |
5025 | Character.Torso.CFrame=Sav | |
5026 | YOURCLONE.Humanoid.Health=Character.Humanoid.Health | |
5027 | Character.Humanoid.Health=Sav2 | |
5028 | end | |
5029 | if YOURCLONE== nil then | |
5030 | yclone() | |
5031 | end | |
5032 | end | |
5033 | if dimension==workspace then | |
5034 | if k=='f' and IsWearingArmor == false and Invisible == false and reload2==false then | |
5035 | reload2=true | |
5036 | M=Instance.new('Part',Character) | |
5037 | M.Shape='Ball' | |
5038 | M.Material='Glass' | |
5039 | M.BrickColor=BrickColor.new('Gold') | |
5040 | M.Transparency=.5 | |
5041 | M.Position=Character.Torso.Position | |
5042 | M.Size=Vector3.new(10,10,10) | |
5043 | M.CanCollide=false | |
5044 | M.Touched:connect(function(h) | |
5045 | if h.Parent~=Character or h.Parent~=workspace or h.Parent~=AdvancingFortress or h.Parent~=MEF then | |
5046 | if h:IsA('Part') and h.Anchored==false then | |
5047 | h.Velocity=Vector3.new(math.random(-70,70),math.random(40,50),math.random(-70,70)) | |
5048 | end | |
5049 | end | |
5050 | end) | |
5051 | W=Instance.new('Weld',Character) | |
5052 | W.Part0=M | |
5053 | W.Part1=Character.Torso | |
5054 | wait(10) | |
5055 | M:remove() | |
5056 | wait(10) | |
5057 | reload2=false | |
5058 | end | |
5059 | if k=='e' and IsWearingArmor == false and Invisible == false then | |
5060 | Long=true | |
5061 | Lattack() | |
5062 | end | |
5063 | if attack == false and ora == false and k == "z" and IsWearingArmor == false and Invisible == false then | |
5064 | ora = true | |
5065 | ORA() | |
5066 | elseif attack == false and k == "x" and IsWearingArmor == false and Invisible == false then | |
5067 | GRABEMBOIGRABEM() | |
5068 | elseif attack == false and k=='g' then | |
5069 | -- FireProjectiles()--thats lame | |
5070 | if changeidle==1 then | |
5071 | changeidle=2 | |
5072 | else changeidle=1 | |
5073 | end | |
5074 | ||
5075 | end | |
5076 | end | |
5077 | ||
5078 | if attack == false and k == "q" and Invisible == false and IsWearingArmor == false then | |
5079 | Invisible = true | |
5080 | Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1) | |
5081 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1, 1) | |
5082 | Disappear() | |
5083 | elseif attack == false and k == "q" and Invisible == true and IsWearingArmor == false then | |
5084 | Invisible = false | |
5085 | Effects.Sphere.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.08) | |
5086 | ||
5087 | for i = 1, 2 do | |
5088 | Effects.Block.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1, 4, 4, 4, 0.1, 1) | |
5089 | end | |
5090 | for i = 1, 20 do | |
5091 | Effects.Break.Create(BrickColor.new("Pastel blue-green"), Torso.CFrame, 1, 1, 1) | |
5092 | end | |
5093 | Reappear() | |
5094 | G=Instance.new('Sound',AdvancingFortress.FTorso) | |
5095 | G.Name='FLEF' | |
5096 | G.SoundId='rbxassetid://1275713993' | |
5097 | G.Volume=3 | |
5098 | G:Play() | |
5099 | elseif attack == false and ShieldMode == false and k == "c" and IsWearingArmor == false and Invisible == false and dimension==workspace then | |
5100 | ShieldMode = true | |
5101 | HoloHexShield() | |
5102 | elseif attack == false and k == "v" and IsWearingArmor == false and Invisible == false and dimension==workspace then | |
5103 | CastleCrusherFist() | |
5104 | ||
5105 | end | |
5106 | --[[if k == "[" and IsWearingArmor == false and Invisible == false then | |
5107 | Armor("On") | |
5108 | end | |
5109 | if k == "]" and IsWearingArmor == true and Invisible == false then | |
5110 | Armor("Off") | |
5111 | end--]] | |
5112 | end) | |
5113 | ||
5114 | Mouse.KeyUp:connect(function(k) | |
5115 | k = k:lower() | |
5116 | if attack == true and ora == true and k == "z" and IsWearingArmor == false then | |
5117 | ora = false | |
5118 | elseif attack == true and ShieldMode == true and k == "c" and IsWearingArmor == false then | |
5119 | ShieldMode = false | |
5120 | end | |
5121 | end) | |
5122 | -- coroutine.resume(coroutine.create(function(Part, Part2) | |
5123 | -- while Part.Parent ~= nil do | |
5124 | -- swait(math.random(100, 150)) | |
5125 | -- for i = 0, 1, 0.2 do | |
5126 | -- wait() | |
5127 | -- Eye1.Mesh.Scale = Vector3.new(1, 0.7 - 1 * i, 1) | |
5128 | -- Eye2.Mesh.Scale = Vector3.new(1, 0.7 - 1 * i, 1) | |
5129 | -- end | |
5130 | -- for i = 0, 1, 0.2 do | |
5131 | -- swait() | |
5132 | -- Eye1.Mesh.Scale = Vector3.new(1, 0.7 + 0.3 * i, 1) | |
5133 | -- Eye2.Mesh.Scale = Vector3.new(1, 0.7 + 0.3 * i, 1) | |
5134 | -- end | |
5135 | -- end | |
5136 | -- end), Eye1, Eye2) | |
5137 | tfk=CFuncs.Sound.Create(1325068271, Character.Torso, 1.5, 1) | |
5138 | tfk.Name='THEME' | |
5139 | tfk.Looped=true | |
5140 | changeidle=1 | |
5141 | YOURCLONE=nil | |
5142 | candecide=true | |
5143 | Humanoid=Character.Humanoid | |
5144 | while true do | |
5145 | ||
5146 | ||
5147 | for _,v in pairs(AdvancingFortress.FTorso:GetChildren()) do | |
5148 | end | |
5149 | swait() | |
5150 | for i, v in pairs(Character:children()) do | |
5151 | if v:IsA("Part") and IsWearingArmor == true then | |
5152 | v.Anchored = false | |
5153 | end | |
5154 | end | |
5155 | for i, v in pairs(AdvancingFortress:GetChildren()) do | |
5156 | if v:IsA("Part") then | |
5157 | v.Material = "SmoothPlastic" | |
5158 | v.CanCollide = false | |
5159 | elseif v:IsA("Humanoid") then | |
5160 | v:remove() | |
5161 | elseif v:IsA("Accessory") then | |
5162 | v:remove() | |
5163 | elseif v:IsA("Shirt") then | |
5164 | v:remove() | |
5165 | elseif v:IsA("Pants") then | |
5166 | v:remove() | |
5167 | elseif v:IsA("Script") or v:IsA("LocalScript") then | |
5168 | v:remove() | |
5169 | elseif v:IsA("BodyColors") then | |
5170 | v:remove() | |
5171 | end | |
5172 | end | |
5173 | AHandleR.Transparency = 1 | |
5174 | AHandleL.Transparency = 1 | |
5175 | RootPart.Transparency = 1 | |
5176 | HitboxR.Transparency = 1 | |
5177 | HitboxL.Transparency = 1 | |
5178 | Head.BrickColor = BrickColor.new("Pastel blue-green") | |
5179 | Torso.BrickColor = BrickColor.new("Pastel blue-green") | |
5180 | RightArm.BrickColor = BrickColor.new("Pastel blue-green") | |
5181 | LeftArm.BrickColor = BrickColor.new("Pastel blue-green") | |
5182 | RightLeg.BrickColor = BrickColor.new("Pastel blue-green") | |
5183 | LeftLeg.BrickColor = BrickColor.new("Pastel blue-green") | |
5184 | RootPart.Anchored = true | |
5185 | Torsovelocity = (Character.HumanoidRootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
5186 | velocity = Character.HumanoidRootPart.Velocity.y | |
5187 | sine = sine + change | |
5188 | Shield.Anchored = true | |
5189 | Shield.CFrame = Shield.CFrame:lerp(RootPart.CFrame * CFrame.new(0, 0, -3.2), 1) | |
5190 | local hit, pos = rayCast(Character.HumanoidRootPart.Position, CFrame.new(Character.HumanoidRootPart.Position, Character.HumanoidRootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character) | |
5191 | if Character.HumanoidRootPart.Velocity.y > 1 and hit == nil then | |
5192 | Anim = "Jump" | |
5193 | if attack == false then | |
5194 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5) | |
5195 | PlayAnimationFromTable({ | |
5196 | CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(.5, -1, 0), | |
5197 | CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, 1, 0), | |
5198 | CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5), | |
5199 | CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1), | |
5200 | CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
5201 | CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0) | |
5202 | }, 0.3, false) | |
5203 | end | |
5204 | elseif Character.HumanoidRootPart.Velocity.y < -1 and hit == nil then | |
5205 | Anim = "Fall" | |
5206 | if attack == false then | |
5207 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5) | |
5208 | PlayAnimationFromTable({ | |
5209 | CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, -1, 1), | |
5210 | CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, 1, 0.5), | |
5211 | CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5), | |
5212 | CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1), | |
5213 | CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
5214 | CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0) | |
5215 | }, 0.3, false) | |
5216 | end | |
5217 | elseif Torsovelocity < 1 and hit ~= nil then | |
5218 | Anim = "Idle" | |
5219 | if changeidle==1 then | |
5220 | if attack == false then | |
5221 | change = 1 | |
5222 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5) | |
5223 | PlayAnimationFromTable({ | |
5224 | CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, -1, 1), | |
5225 | CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, 1, 0.5), | |
5226 | CFrame.new(1.5,0,0) * CFrame.new(-1.2, 0, -.3) * CFrame.Angles(1.5, 0, -1.5), | |
5227 | CFrame.new(-1.5,0,0) * CFrame.new(1.5, 0.3, -.5) * CFrame.Angles(3, 0, 1), | |
5228 | CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
5229 | CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0) | |
5230 | }, 0.3, false) | |
5231 | end | |
5232 | elseif changeidle==2 then | |
5233 | change = 1 | |
5234 | if not attack then | |
5235 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5) | |
5236 | PlayAnimationFromTable({ | |
5237 | CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
5238 | CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
5239 | CFrame.new(1.5,0,0) * CFrame.new(-1.5, 0.4, -.5) * CFrame.Angles(3, 0, -1), | |
5240 | CFrame.new(-1.5,0,0) * CFrame.new(1.5, 0.4, -.5) * CFrame.Angles(3, 0, 1), | |
5241 | CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
5242 | CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0) | |
5243 | }, 0.3, false) | |
5244 | end | |
5245 | end | |
5246 | elseif Torsovelocity > 2 and hit ~= nil then | |
5247 | Anim = "Walk" | |
5248 | if attack == false then | |
5249 | RootPart.CFrame = RootPart.CFrame:lerp(Character.HumanoidRootPart.CFrame * CFrame.new(-2, 1 + 0.5 * math.cos(sine / 20), 3), 0.5) | |
5250 | PlayAnimationFromTable({ | |
5251 | CFrame.new(0,0,0) * CFrame.new(0, 0, 0) * CFrame.Angles(-1, -1, 0), | |
5252 | CFrame.new(0,1.5,0) * CFrame.new(0, 0, 0) * CFrame.Angles(1, 0, 0), | |
5253 | CFrame.new(1.5,0,0) * CFrame.new(-1, 0, -.3) * CFrame.Angles(1.5, 0, -1.5), | |
5254 | CFrame.new(-1.5,0,0) * CFrame.new(1, 0, -.5) * CFrame.Angles(3, 0, 1), | |
5255 | CFrame.new(.5,-2,0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), | |
5256 | CFrame.new(-.5,-2,0) * CFrame.new(0, 0.5, -0.3) * CFrame.Angles(-.5, 0, 0) | |
5257 | }, 0.3, false) | |
5258 | end | |
5259 | end | |
5260 | if 0 < #Effects then | |
5261 | for e = 1, #Effects do | |
5262 | if Effects[e] ~= nil then | |
5263 | local Thing = Effects[e] | |
5264 | if Thing ~= nil then | |
5265 | local Part = Thing[1] | |
5266 | local Mode = Thing[2] | |
5267 | local Delay = Thing[3] | |
5268 | local IncX = Thing[4] | |
5269 | local IncY = Thing[5] | |
5270 | local IncZ = Thing[6] | |
5271 | if Thing[2] == "Shoot" then | |
5272 | local Look = Thing[1] | |
5273 | local move = 30 | |
5274 | if Thing[8] == 3 then | |
5275 | move = 10 | |
5276 | end | |
5277 | local hit, pos = rayCast(Thing[4], Thing[1], move, m) | |
5278 | if Thing[10] ~= nil then | |
5279 | da = pos | |
5280 | cf2 = CFrame.new(Thing[4], Thing[10].Position) | |
5281 | cfa = CFrame.new(Thing[4], pos) | |
5282 | tehCF = cfa:lerp(cf2, 0.2) | |
5283 | Thing[1] = tehCF.lookVector | |
5284 | end | |
5285 | local mag = (Thing[4] - pos).magnitude | |
5286 | Effects.Head.Create(Torso.BrickColor, CFrame.new((Thing[4] + pos) / 2, pos) * CFrame.Angles(1.57, 0, 0), 1, mag * 5, 1, 0.5, 0, 0.5, 0.2) | |
5287 | if Thing[8] == 2 then | |
5288 | Effects.Ring.Create(Torso.BrickColor, CFrame.new((Thing[4] + pos) / 2, pos) * CFrame.Angles(1.57, 0, 0) * CFrame.fromEulerAnglesXYZ(1.57, 0, 0), 1, 1, 0.1, 0.5, 0.5, 0.1, 0.1, 1) | |
5289 | end | |
5290 | Thing[4] = Thing[4] + Look * move | |
5291 | Thing[3] = Thing[3] - 1 | |
5292 | if 2 < Thing[5] then | |
5293 | Thing[5] = Thing[5] - 0.3 | |
5294 | Thing[6] = Thing[6] - 0.3 | |
5295 | end | |
5296 | if hit ~= nil then | |
5297 | Thing[3] = 0 | |
5298 | if Thing[8] == 1 or Thing[8] == 3 then | |
5299 | Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1) | |
5300 | elseif Thing[8] == 2 then | |
5301 | Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1) | |
5302 | if hit.Parent:findFirstChild("Humanoid") ~= nil or hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then | |
5303 | ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Pastel blue-green"), "Reference", Vector3.new()) | |
5304 | ref.Anchored = true | |
5305 | ref.CFrame = CFrame.new(pos) | |
5306 | CFuncs.Sound.Create("161006093", ref, 1, 1.2) | |
5307 | game:GetService("Debris"):AddItem(ref, 0.2) | |
5308 | Effects.Block.Create(Torso.BrickColor, CFrame.new(ref.Position) * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 1, 1, 10, 10, 10, 0.1, 2) | |
5309 | Effects.Ring.Create(BrickColor.new("Bright yellow"), CFrame.new(ref.Position) * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 1, 0.1, 4, 4, 0.1, 0.1) | |
5310 | MagnitudeDamage(ref, 15, Thing[5] / 1.5, Thing[6] / 1.5, 0, "Normal", "", 1) | |
5311 | end | |
5312 | end | |
5313 | ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Pastel blue-green"), "Reference", Vector3.new()) | |
5314 | ref.Anchored = true | |
5315 | ref.CFrame = CFrame.new(pos) | |
5316 | Effects.Sphere.Create(Torso.BrickColor, CFrame.new(pos), 5, 5, 5, 1, 1, 1, 0.07) | |
5317 | game:GetService("Debris"):AddItem(ref, 1) | |
5318 | end | |
5319 | if Thing[3] <= 0 then | |
5320 | table.remove(Effects, e) | |
5321 | end | |
5322 | end | |
5323 | if Thing[2] == "FireWave" then | |
5324 | if Thing[3] <= Thing[4] then | |
5325 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(0, 1, 0) | |
5326 | Thing[3] = Thing[3] + 1 | |
5327 | Thing[6].Scale = Thing[6].Scale + Vector3.new(Thing[5], 0, Thing[5]) | |
5328 | else | |
5329 | Part.Parent = nil | |
5330 | table.remove(Effects, e) | |
5331 | end | |
5332 | end | |
5333 | if Thing[2] ~= "Shoot" and Thing[2] ~= "Wave" and Thing[2] ~= "FireWave" then | |
5334 | if Thing[1].Transparency <= 1 then | |
5335 | if Thing[2] == "Block1" then | |
5336 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
5337 | Mesh = Thing[7] | |
5338 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
5339 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5340 | elseif Thing[2] == "Block2" then | |
5341 | Thing[1].CFrame = Thing[1].CFrame | |
5342 | Mesh = Thing[7] | |
5343 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
5344 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5345 | elseif Thing[2] == "Fire" then | |
5346 | Thing[1].CFrame = CFrame.new(Thing[1].Position) + Vector3.new(0, 0.2, 0) | |
5347 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
5348 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5349 | elseif Thing[2] == "Cylinder" then | |
5350 | Mesh = Thing[7] | |
5351 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
5352 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5353 | elseif Thing[2] == "Blood" then | |
5354 | Mesh = Thing[7] | |
5355 | Thing[1].CFrame = Thing[1].CFrame * CFrame.new(0, 0.5, 0) | |
5356 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
5357 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5358 | elseif Thing[2] == "Elec" then | |
5359 | Thing[1].Size = Thing[1].Size + Vector3.new(Thing[7], Thing[8], Thing[9]) | |
5360 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5361 | elseif Thing[2] == "Disappear" then | |
5362 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5363 | elseif Thing[2] == "Shatter" then | |
5364 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
5365 | Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0) | |
5366 | Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0) | |
5367 | Thing[6] = Thing[6] + Thing[5] | |
5368 | end | |
5369 | else | |
5370 | Part.Parent = nil | |
5371 | table.remove(Effects, e) | |
5372 | end | |
5373 | end | |
5374 | end | |
5375 | end | |
5376 | end | |
5377 | end | |
5378 | end |