SHOW:
|
|
- or go back to the newest paste.
1 | -- Location: Players.Cronizete.Character.BODYGUARDSV2 | |
2 | -- Synapse Decompiler | |
3 | -- Purchase Here: https://brack4712.xyz/synapse/purchase | |
4 | ||
5 | ||
6 | print("X = Summon a bodyguard") | |
7 | print("M = Change Types of bodyguards Snipers, riflers Sniper is the default") | |
8 | print("Q = Aim") | |
9 | print("C = Makes all the bodyguards disappear") | |
10 | print("Click = Shoot You have to aim at somebody for snipers, you don't have to for the rifles)") | |
11 | ||
12 | --// Controls | |
13 | --// X = Summon a bodyguard | |
14 | --// M = Change Types of bodyguards (Snipers, riflers) Sniper is the default | |
15 | --// Q = Aim | |
16 | --// C = Makes all the bodyguards disappear. | |
17 | --// Click = Shoot (You have to aim at somebody for snipers, you don't have to for the rifles) | |
18 | ||
19 | plr = game:service'Players'.LocalPlayer | |
20 | char = plr.Character | |
21 | ||
22 | --// Anti double | |
23 | script.Name = "BODYGUARDSV2_TEMP" | |
24 | for _, a in pairs(char:GetDescendants()) do | |
25 | if a.Name == "BODYGUARDSV2" then | |
26 | a:Destroy() | |
27 | elseif a.Name == "" then | |
28 | a:Destroy() | |
29 | end | |
30 | end | |
31 | script.Name = "BODYGUARDSV2" | |
32 | --// Main Script | |
33 | ||
34 | head = char.Head | |
35 | mouse = plr:GetMouse() | |
36 | sam = 0 | |
37 | char.Archivable = true | |
38 | arms = nil | |
39 | torso = nil | |
40 | follow = false | |
41 | current = nil | |
42 | curfollow = nil | |
43 | rifleshoot = false | |
44 | targ, huma = nil,nil | |
45 | char.Humanoid.MaxHealth = math.huge | |
46 | wait() | |
47 | char.Humanoid.Health = math.huge | |
48 | ||
49 | --// points | |
50 | point1 = Instance.new('Part', char) | |
51 | point1.Anchored = false | |
52 | point1.CanCollide = false | |
53 | point1.Transparency = 1 | |
54 | point1.Size = Vector3.new(0.2,0.2,0.2) | |
55 | ||
56 | Weld = Instance.new("Weld",game.Players.LocalPlayer.Character) | |
57 | Weld.Part0 = game.Players.LocalPlayer.Character["Torso"] | |
58 | Weld.Part1 = point1 | |
59 | Weld.C1 = CFrame.new(10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0) | |
60 | ||
61 | point2 = Instance.new('Part', char) | |
62 | point2.Anchored = false | |
63 | point2.CanCollide = false | |
64 | point2.Transparency = 1 | |
65 | point2.Size = Vector3.new(0.2,0.2,0.2) | |
66 | ||
67 | Weld = Instance.new("Weld",game.Players.LocalPlayer.Character) | |
68 | Weld.Part0 = game.Players.LocalPlayer.Character["Torso"] | |
69 | Weld.Part1 = point2 | |
70 | Weld.C1 = CFrame.new(-10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0) | |
71 | --// points | |
72 | ||
73 | --// Configuration | |
74 | ||
75 | max = 15 | |
76 | max1 = 2 | |
77 | maxammo = 30 | |
78 | mode = "Snipers" | |
79 | ||
80 | --// | |
81 | ||
82 | snipers,riflers,welds = {},{},{} | |
83 | ||
84 | skinc = { | |
85 | 'Rust', | |
86 | 'Cool yellow', | |
87 | 'Br. yellowish orange', | |
88 | 'Pastel yellow', | |
89 | 'CGA brown' | |
90 | } | |
91 | ||
92 | props = { | |
93 | 'HeadColor', | |
94 | 'LeftArmColor', | |
95 | 'RightArmColor', | |
96 | 'TorsoColor', | |
97 | 'RightLegColor', | |
98 | 'LeftLegColor' | |
99 | } | |
100 | ||
101 | snpr = char:Clone() | |
102 | snpr.Name = "" | |
103 | ||
104 | for _, a in pairs(snpr:children()) do | |
105 | if a:IsA'CharacterMesh' or a:IsA'Accessory' or a:IsA'Shirt' or a:IsA'Pants' then | |
106 | a:Destroy() | |
107 | end | |
108 | end | |
109 | ||
110 | snpr.Parent = nil | |
111 | ||
112 | bg = Instance.new("BodyGyro", snpr.HumanoidRootPart) | |
113 | bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
114 | bg.Name = "FOLLOW" | |
115 | bg.P = 10000 | |
116 | bg.D = 100 | |
117 | ||
118 | sfx = Instance.new('Sound', snpr.Head) | |
119 | sfx.SoundId = "rbxassetid://740599871" | |
120 | sfx.Volume = 3 | |
121 | sfx2 = Instance.new('Sound', snpr) | |
122 | sfx2.Name = "SNIPERSOUND" | |
123 | sfx2.SoundId = "rbxassetid://136523485" | |
124 | sfx2.Volume = 3 | |
125 | ||
126 | lazor = Instance.new('Part', snpr) | |
127 | lazor.Name = "Laser" | |
128 | lazor.Anchored = true | |
129 | lazor.Shape = Enum.PartType.Ball | |
130 | lazor.Size = Vector3.new(0.3,0.3,0.3) | |
131 | lazor.BrickColor = BrickColor.new('Really red') | |
132 | lazor.Transparency = 0.4 | |
133 | lazor.CanCollide = false | |
134 | ||
135 | shirt = Instance.new('Shirt', snpr) | |
136 | shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=139465409" | |
137 | pants = Instance.new('Pants', snpr) | |
138 | pants.PantsTemplate = "http://www.roblox.com/asset/?id=139466214" | |
139 | ---------------------------------------------------------------- | |
140 | hat = Instance.new('Part', snpr) | |
141 | hat.Name = 'Hat' | |
142 | hat.Anchored = false | |
143 | hat.CanCollide = false | |
144 | mesh = Instance.new('SpecialMesh', hat) | |
145 | mesh.MeshId = "http://www.roblox.com/asset/?id=31152467" | |
146 | mesh.TextureId = "http://www.roblox.com/asset/?id=32002857" | |
147 | mesh.Scale = Vector3.new(1,1,1) | |
148 | weld = Instance.new('Weld', hat) | |
149 | weld.Part0 = hat | |
150 | weld.Part1 = snpr.Head | |
151 | weld.C0 = CFrame.new(0,-0.2,0) | |
152 | -------------------------------------------- | |
153 | sniper = Instance.new('Part', snpr) | |
154 | sniper.Anchored = false | |
155 | sniper.CanCollide = false | |
156 | sniper.Name = "Sniper" | |
157 | sniper.Size = Vector3.new(7.88, 1.77, 1) | |
158 | mesh = Instance.new('SpecialMesh', sniper) | |
159 | mesh.MeshId = "rbxassetid://462309398" | |
160 | mesh.TextureId = "rbxassetid://462309404" | |
161 | mesh.Scale = Vector3.new(0.006, 0.006, 0.006) | |
162 | weld = Instance.new('Weld', sniper) | |
163 | weld.Part0 = sniper | |
164 | weld.Part1 = snpr.Head | |
165 | weld.C0 = CFrame.new(-2,0.5,-0.2) * CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0)) | |
166 | ||
167 | arms = {snpr:FindFirstChild("Left Arm"), snpr:FindFirstChild("Right Arm")} | |
168 | torso = snpr:FindFirstChild("Torso") | |
169 | ||
170 | if arms ~= nil and torso ~= nil then | |
171 | local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")} | |
172 | if sh ~= nil then | |
173 | local yes = true | |
174 | if yes then | |
175 | yes = false | |
176 | sh[1].Part1 = nil | |
177 | sh[2].Part1 = nil | |
178 | local weld1 = Instance.new("Weld") | |
179 | weld1.Part0 = torso | |
180 | weld1.Parent = torso | |
181 | weld1.Part1 = arms[1] | |
182 | weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
183 | welds[1] = weld1 | |
184 | local weld2 = Instance.new("Weld") | |
185 | weld2.Part0 = torso | |
186 | weld2.Parent = torso | |
187 | weld2.Part1 = arms[2] | |
188 | weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
189 | welds[2] = weld2 | |
190 | end | |
191 | end | |
192 | end | |
193 | ||
194 | function sniper(pos) | |
195 | if sam <= max - 1 then | |
196 | local sniper = snpr:Clone() | |
197 | local bodyc = sniper:FindFirstChildOfClass'BodyColors' | |
198 | local skincolor = skinc[math.random(1,5)] | |
199 | ||
200 | for _, a in pairs(props) do | |
201 | bodyc[a] = BrickColor.new(skincolor) | |
202 | end | |
203 | ||
204 | sniper.Parent = char | |
205 | sniper:MoveTo(pos) | |
206 | sniper.Torso.CFrame = CFrame.new(sniper.Torso.Position, head.Position) | |
207 | table.insert(snipers, sniper) | |
208 | sam = sam + 1 | |
209 | end | |
210 | end | |
211 | ||
212 | function rifler(pos) | |
213 | if sam <= max1 - 1 then | |
214 | local rifler = snpr:Clone() | |
215 | local bodyc = rifler:FindFirstChildOfClass'BodyColors' | |
216 | local skincolor = skinc[math.random(1,5)] | |
217 | ||
218 | for _, a in pairs(props) do | |
219 | bodyc[a] = BrickColor.new(skincolor) | |
220 | end | |
221 | ||
222 | for _, a in pairs(rifler:GetDescendants()) do | |
223 | if a:IsA'BodyGyro' then | |
224 | a:Destroy() | |
225 | end | |
226 | end | |
227 | ||
228 | rifler.Parent = char | |
229 | rifler:MoveTo(pos) | |
230 | rifler.Torso.CFrame = CFrame.new(rifler.Torso.Position, head.Position) | |
231 | rifler:FindFirstChild'SNIPERSOUND'.Pitch = 1.2 | |
232 | rifle = rifler:FindFirstChild'Sniper' | |
233 | rifle.Name = "Rifle" | |
234 | rifle:FindFirstChildOfClass'SpecialMesh'.TextureId = "rbxassetid://546505949" | |
235 | rifle:FindFirstChildOfClass'SpecialMesh'.MeshId = "rbxassetid://546505802" | |
236 | rifle:FindFirstChildOfClass'SpecialMesh'.Scale = Vector3.new(0.2, 0.2, 0.2) | |
237 | rifle:FindFirstChildOfClass'Weld'.C0 = CFrame.new(-.4,.6,1.6) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)) | |
238 | table.insert(riflers, rifler) | |
239 | sam = sam + 1 | |
240 | end | |
241 | end | |
242 | ||
243 | function ray(a,b) | |
244 | local ray = Ray.new(a.CFrame.p, (b - a.CFrame.p).unit * 700) | |
245 | local part, position = workspace:FindPartOnRay(ray, char, false, true) | |
246 | ||
247 | local beam = Instance.new("Part", workspace) | |
248 | beam.FormFactor = "Custom" | |
249 | beam.Material = "Plastic" | |
250 | beam.Transparency = 0.25 | |
251 | beam.Anchored = true | |
252 | beam.Locked = true | |
253 | beam.CanCollide = false | |
254 | beam.BrickColor = BrickColor.new('Really black') | |
255 | ||
256 | local distance = (a.CFrame.p - position).magnitude | |
257 | beam.Size = Vector3.new(0.08, 0.08, distance) | |
258 | beam.CFrame = CFrame.new(a.CFrame.p, position) * CFrame.new(0, 0, -distance / 2) | |
259 | ||
260 | game:GetService('Debris'):AddItem(beam, 0.1) | |
261 | end | |
262 | ||
263 | mouse.KeyDown:connect(function(k) | |
264 | local key = k:lower() | |
265 | if key == "x" then | |
266 | follow = false | |
267 | if mode == "Snipers" then | |
268 | sniper(mouse.Hit.p) | |
269 | elseif mode == "Riflers" then | |
270 | rifler(mouse.Hit.p) | |
271 | end | |
272 | wait(.3) | |
273 | if curfollow then | |
274 | follow = true | |
275 | elseif not curfollow then | |
276 | follow = false | |
277 | end | |
278 | elseif key == "c" then | |
279 | for _, a in pairs(char:children()) do | |
280 | if a.Name == "" then | |
281 | for i = 1,10 do | |
282 | a:FindFirstChild'HumanoidRootPart'.CFrame = a:FindFirstChild'HumanoidRootPart'.CFrame * CFrame.new(0,-i + 0.8,0) | |
283 | wait() | |
284 | end | |
285 | wait(.15) | |
286 | a:Destroy() | |
287 | sam = sam - 1 | |
288 | end | |
289 | end | |
290 | elseif key == "m" then | |
291 | if mode == "Snipers" then | |
292 | mode = "Riflers" | |
293 | elseif mode == "Riflers" then | |
294 | mode = "Snipers" | |
295 | end | |
296 | elseif key == "q" then | |
297 | if not follow then | |
298 | follow = true | |
299 | curfollow = true | |
300 | on = false | |
301 | for i = 1, sam / 2 do | |
302 | wait(.6) | |
303 | local now | |
304 | ypcall(function() | |
305 | if mode == "Snipers" then | |
306 | now = snipers[math.random(1,#snipers)] | |
307 | elseif mode == "Riflers" then | |
308 | now = riflers[math.random(1,#riflers)] | |
309 | end | |
310 | end) | |
311 | for _, a in pairs(riflers) do | |
312 | bg = Instance.new("BodyGyro", a.HumanoidRootPart) | |
313 | bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
314 | bg.Name = "FOLLOW" | |
315 | bg.P = 10000 | |
316 | bg.D = 100 | |
317 | end | |
318 | now.Head.Sound:Resume() | |
319 | current = now.Head.Sound.SoundId | |
320 | end | |
321 | elseif follow then | |
322 | for _, a in pairs(riflers) do | |
323 | for _, b in pairs(a:GetDescendants()) do | |
324 | if b:IsA'BodyGyro' then | |
325 | b:Destroy() | |
326 | end | |
327 | end | |
328 | end | |
329 | follow = false | |
330 | curfollow = false | |
331 | end | |
332 | end | |
333 | end) | |
334 | ||
335 | mouse.Button1Down:connect(function() | |
336 | if follow and mode ~= "Riflers" and mouse.Target and mouse.Target.Parent and mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then | |
337 | follow = false | |
338 | local targ = mouse.Target | |
339 | huma = targ.Parent:FindFirstChildOfClass'Humanoid' | |
340 | for _, a in pairs(targ.Parent:children()) do | |
341 | if a:IsA'ForceField' then | |
342 | a:Destroy() | |
343 | end | |
344 | end | |
345 | huma.MaxHealth = 100 | |
346 | huma.Name = "Humanoid" | |
347 | if mode == "Snipers" then | |
348 | for _, a in pairs(snipers) do | |
349 | if a:FindFirstChild'HumanoidRootPart' then | |
350 | wait(.2) | |
351 | rootpart = a.HumanoidRootPart | |
352 | snd = rootpart.Parent:FindFirstChild'SNIPERSOUND' | |
353 | snd:Play() | |
354 | ray(a:FindFirstChild'Sniper',targ.Parent.Head.Position) | |
355 | huma:TakeDamage(huma.MaxHealth/2/2/2) | |
356 | end | |
357 | end | |
358 | follow = true | |
359 | end | |
360 | end | |
361 | end) | |
362 | ||
363 | mouse.Button1Down:connect(function() | |
364 | if mode == "Riflers" then | |
365 | rifleshoot = true | |
366 | end | |
367 | end) | |
368 | ||
369 | mouse.Button1Up:connect(function() | |
370 | if mode == "Riflers" then | |
371 | rifleshoot = false | |
372 | end | |
373 | end) | |
374 | ||
375 | while wait() do | |
376 | ypcall(function() | |
377 | riflers[1]:FindFirstChildOfClass'Humanoid':MoveTo(point1.Position) | |
378 | riflers[2]:FindFirstChildOfClass'Humanoid':MoveTo(point2.Position) | |
379 | end) | |
380 | if follow then | |
381 | if mode == "Snipers" then | |
382 | for _, a in pairs(snipers) do | |
383 | if a:FindFirstChild'HumanoidRootPart' then | |
384 | rootpart = a.HumanoidRootPart | |
385 | rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0)) | |
386 | rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit | |
387 | end | |
388 | end | |
389 | elseif mode == "Riflers" then | |
390 | for _, a in pairs(riflers) do | |
391 | if a:FindFirstChild'HumanoidRootPart' then | |
392 | rootpart = a.HumanoidRootPart | |
393 | ypcall(function() rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0)) end) | |
394 | rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit | |
395 | end | |
396 | end | |
397 | end | |
398 | end | |
399 | if rifleshoot and follow and mouse.Target and mouse.Target.Parent then | |
400 | local targ = mouse.Target | |
401 | local huma = nil | |
402 | if targ.Parent:FindFirstChildOfClass'Humanoid' then | |
403 | huma = targ.Parent:FindFirstChildOfClass'Humanoid' | |
404 | else | |
405 | huma = nil | |
406 | end | |
407 | if huma ~= nil then | |
408 | for _, a in pairs(riflers) do | |
409 | if a:FindFirstChild'HumanoidRootPart' and huma.Health ~= 0 then | |
410 | wait(.02) | |
411 | rootpart = a.HumanoidRootPart | |
412 | snd = rootpart.Parent:FindFirstChild'SNIPERSOUND' | |
413 | snd.Pitch = 80 | |
414 | snd:Resume() | |
415 | ray(a:FindFirstChild'Rifle',targ.Parent.Head.Position) | |
416 | huma:TakeDamage(huma.MaxHealth/2/2/2/2/2) | |
417 | end | |
418 | end | |
419 | else | |
420 | for _, a in pairs(riflers) do | |
421 | snd = rootpart.Parent:FindFirstChild'SNIPERSOUND' | |
422 | snd.Pitch = 80 | |
423 | snd:Resume() | |
424 | ray(a:FindFirstChild'Rifle',mouse.Hit.p) | |
425 | end | |
426 | end | |
427 | end | |
428 | end |