SHOW:
|
|
- or go back to the newest paste.
| 1 | wait(1) | |
| 2 | ---------------------------[[[ VARIABLES ]]]--------------------------- | |
| 3 | ||
| 4 | local plr = game.Players.LocalPlayer | |
| 5 | local chr = plr.Character | |
| 6 | local mou = plr:GetMouse() | |
| 7 | local leftarm = false | |
| 8 | local active = false | |
| 9 | local curkey = "f" | |
| 10 | local stunneds = {}
| |
| 11 | ||
| 12 | ---------------------------[[[ PARTS ]]]--------------------------- | |
| 13 | ||
| 14 | -- 1 - Glock | |
| 15 | obj1 = Instance.new("Model")
| |
| 16 | obj1.Name = "Glock" | |
| 17 | obj1.Parent = chr | |
| 18 | ||
| 19 | -- 2 - Part | |
| 20 | obj2 = Instance.new("Part")
| |
| 21 | obj2.CFrame = CFrame.new(Vector3.new(14.25, 3.51428652, 46.8584824)) * CFrame.Angles(0.69812995195389, 0, -0) | |
| 22 | obj2.TopSurface = Enum.SurfaceType.Smooth | |
| 23 | obj2.BottomSurface = Enum.SurfaceType.Smooth | |
| 24 | obj2.Material = Enum.Material.Metal | |
| 25 | obj2.Size = Vector3.new(0.300000012, 0.200000003, 0.200000003) | |
| 26 | obj2.Anchored = true | |
| 27 | obj2.BrickColor = BrickColor.new("Black")
| |
| 28 | obj2.Friction = 0.30000001192093 | |
| 29 | obj2.Shape = Enum.PartType.Block | |
| 30 | obj2.CanCollide = false | |
| 31 | obj2.Parent = obj1 | |
| 32 | ||
| 33 | -- 3 - Top | |
| 34 | obj3 = Instance.new("Part")
| |
| 35 | obj3.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.1499977)) * CFrame.Angles(-0, 0, -0) | |
| 36 | obj3.TopSurface = Enum.SurfaceType.Smooth | |
| 37 | obj3.BottomSurface = Enum.SurfaceType.Smooth | |
| 38 | obj3.Material = Enum.Material.Metal | |
| 39 | obj3.Size = Vector3.new(0.300000012, 0.300000012, 1.5) | |
| 40 | obj3.Anchored = true | |
| 41 | obj3.BrickColor = BrickColor.new("Ghost grey")
| |
| 42 | obj3.Friction = 0.30000001192093 | |
| 43 | obj3.Shape = Enum.PartType.Block | |
| 44 | obj3.CanCollide = false | |
| 45 | obj3.Name = "Top" | |
| 46 | obj3.Parent = obj1 | |
| 47 | ||
| 48 | -- 4 - Top | |
| 49 | obj4 = Instance.new("Part")
| |
| 50 | obj4.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0) | |
| 51 | obj4.TopSurface = Enum.SurfaceType.Smooth | |
| 52 | obj4.BottomSurface = Enum.SurfaceType.Smooth | |
| 53 | obj4.Material = Enum.Material.Metal | |
| 54 | obj4.Size = Vector3.new(0.200000003, 0.299999982, 0.300000012) | |
| 55 | obj4.Anchored = true | |
| 56 | obj4.BrickColor = BrickColor.new("Ghost grey")
| |
| 57 | obj4.Friction = 0.30000001192093 | |
| 58 | obj4.Shape = Enum.PartType.Cylinder | |
| 59 | obj4.Name = "Top" | |
| 60 | obj4.CanCollide = false | |
| 61 | obj4.Parent = obj1 | |
| 62 | ||
| 63 | -- 5 - Part | |
| 64 | obj5 = Instance.new("Part")
| |
| 65 | obj5.CFrame = CFrame.new(Vector3.new(14.25, 3.35359001, 47.1499939)) * CFrame.Angles(-1.5707978010178, 0, -0) | |
| 66 | obj5.TopSurface = Enum.SurfaceType.Smooth | |
| 67 | obj5.BottomSurface = Enum.SurfaceType.Smooth | |
| 68 | obj5.Material = Enum.Material.Metal | |
| 69 | obj5.Size = Vector3.new(0.300000012, 0.200000003, 0.299999982) | |
| 70 | obj5.Anchored = true | |
| 71 | obj5.BrickColor = BrickColor.new("Black")
| |
| 72 | obj5.Friction = 0.30000001192093 | |
| 73 | obj5.Shape = Enum.PartType.Block | |
| 74 | obj5.CanCollide = false | |
| 75 | obj5.Parent = obj1 | |
| 76 | ||
| 77 | -- 6 - Part | |
| 78 | obj6 = Instance.new("Part")
| |
| 79 | obj6.CFrame = CFrame.new(Vector3.new(14.25, 3.5999999, 47.1499977)) * CFrame.Angles(-0, 0, -0) | |
| 80 | obj6.TopSurface = Enum.SurfaceType.Smooth | |
| 81 | obj6.BottomSurface = Enum.SurfaceType.Smooth | |
| 82 | obj6.Material = Enum.Material.Metal | |
| 83 | obj6.Size = Vector3.new(0.300000012, 0.200000003, 1.5) | |
| 84 | obj6.Anchored = true | |
| 85 | obj6.BrickColor = BrickColor.new("Black")
| |
| 86 | obj6.CanCollide = false | |
| 87 | obj6.Friction = 0.30000001192093 | |
| 88 | obj6.Shape = Enum.PartType.Block | |
| 89 | obj6.Parent = obj1 | |
| 90 | ||
| 91 | -- 7 - Part | |
| 92 | obj7 = Instance.new("Part")
| |
| 93 | obj7.CFrame = CFrame.new(Vector3.new(14.25, 3.60000014, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0) | |
| 94 | obj7.TopSurface = Enum.SurfaceType.Smooth | |
| 95 | obj7.BottomSurface = Enum.SurfaceType.Smooth | |
| 96 | obj7.Material = Enum.Material.Metal | |
| 97 | obj7.Size = Vector3.new(0.200000003, 0.200000003, 0.300000012) | |
| 98 | obj7.Anchored = true | |
| 99 | obj7.BrickColor = BrickColor.new("Black")
| |
| 100 | obj7.CanCollide = false | |
| 101 | obj7.Friction = 0.30000001192093 | |
| 102 | obj7.Shape = Enum.PartType.Cylinder | |
| 103 | obj7.Parent = obj1 | |
| 104 | ||
| 105 | -- 8 - Part | |
| 106 | obj8 = Instance.new("Part")
| |
| 107 | obj8.CFrame = CFrame.new(Vector3.new(14.25, 3.15358996, 46.8499985)) * CFrame.Angles(1.1920913323138e-007, 0, -0) | |
| 108 | obj8.TopSurface = Enum.SurfaceType.Smooth | |
| 109 | obj8.BottomSurface = Enum.SurfaceType.Smooth | |
| 110 | obj8.Material = Enum.Material.Metal | |
| 111 | obj8.Size = Vector3.new(0.300000012, 0.200000003, 0.699999988) | |
| 112 | obj8.Anchored = true | |
| 113 | obj8.BrickColor = BrickColor.new("Black")
| |
| 114 | obj8.Friction = 0.30000001192093 | |
| 115 | obj8.CanCollide = false | |
| 116 | obj8.Shape = Enum.PartType.Block | |
| 117 | obj8.Parent = obj1 | |
| 118 | ||
| 119 | -- 9 - Part | |
| 120 | obj9 = Instance.new("Part")
| |
| 121 | obj9.CFrame = CFrame.new(Vector3.new(14.25, 3.27858996, 46.5067024)) * CFrame.Angles(-1.0471963882446, 0, -0) | |
| 122 | obj9.TopSurface = Enum.SurfaceType.Smooth | |
| 123 | obj9.BottomSurface = Enum.SurfaceType.Smooth | |
| 124 | obj9.Material = Enum.Material.Metal | |
| 125 | obj9.Size = Vector3.new(0.300000012, 0.300000012, 0.699999988) | |
| 126 | obj9.Anchored = true | |
| 127 | obj9.BrickColor = BrickColor.new("Black")
| |
| 128 | obj9.CanCollide = false | |
| 129 | obj9.Friction = 0.30000001192093 | |
| 130 | obj9.Shape = Enum.PartType.Block | |
| 131 | obj9.Parent = obj1 | |
| 132 | ||
| 133 | local previous = nil | |
| 134 | for i,v in pairs(obj1:GetChildren()) do | |
| 135 | if v:IsA('BasePart') then
| |
| 136 | if previous then | |
| 137 | local weld = Instance.new('Weld',v)
| |
| 138 | weld.Part0 = v | |
| 139 | weld.Part1 = previous | |
| 140 | weld.C0 = v.CFrame:inverse() * previous.CFrame | |
| 141 | previous.Anchored = false | |
| 142 | end | |
| 143 | previous = v | |
| 144 | end | |
| 145 | end | |
| 146 | previous.Anchored = false | |
| 147 | ||
| 148 | ---------------------------[[[ FUNCTIONS ]]]--------------------------- | |
| 149 | ||
| 150 | function notify(msg,forever) | |
| 151 | local doit = coroutine.wrap(function() | |
| 152 | for i,v in pairs(plr.PlayerGui:GetChildren()) do | |
| 153 | if v.Name == "Notification" and v:IsA('ScreenGui') then
| |
| 154 | v:Destroy() | |
| 155 | end | |
| 156 | end | |
| 157 | local gui = Instance.new('ScreenGui',plr.PlayerGui)
| |
| 158 | gui.Name = "Notification" | |
| 159 | local frame = Instance.new('Frame',gui)
| |
| 160 | frame.Position = UDim2.new(0,0,0,0) | |
| 161 | frame.Size = UDim2.new(1,0,0.2,0) | |
| 162 | frame.BackgroundTransparency = 1 | |
| 163 | local txt = Instance.new('TextLabel',frame)
| |
| 164 | txt.TextColor3 = Color3.new(255,255,255) | |
| 165 | txt.TextStrokeColor3 = Color3.new(0, 0, 0) | |
| 166 | txt.TextStrokeTransparency = 0 | |
| 167 | txt.BackgroundTransparency = 1 | |
| 168 | txt.Text = "" | |
| 169 | txt.Size = UDim2.new(1,0,0.3,0) | |
| 170 | txt.Position = UDim2.new(0,0,0.4,0) | |
| 171 | txt.TextScaled = true | |
| 172 | txt.Font = "Code" | |
| 173 | txt.TextXAlignment = "Center" | |
| 174 | local tap = Instance.new("Sound")
| |
| 175 | tap.Parent = plr.Backpack | |
| 176 | tap.SoundId = "rbxassetid://147982968" | |
| 177 | tap.TimePosition = 0.1 | |
| 178 | local str = msg | |
| 179 | local len = string.len(str) | |
| 180 | for i=1,len do | |
| 181 | txt.Text = string.sub(str,1,i) | |
| 182 | local pitche = math.random(2, 4) | |
| 183 | tap.PlaybackSpeed = pitche | |
| 184 | tap:Play() | |
| 185 | wait(0.05) | |
| 186 | end | |
| 187 | if forever == false then | |
| 188 | wait(1) | |
| 189 | while txt.TextTransparency < 1 do | |
| 190 | txt.TextTransparency = txt.TextTransparency + 0.1 | |
| 191 | txt.TextStrokeTransparency = txt.TextStrokeTransparency + 0.1 | |
| 192 | wait() | |
| 193 | end | |
| 194 | gui:Destroy() | |
| 195 | end | |
| 196 | end) | |
| 197 | doit() | |
| 198 | end | |
| 199 | ||
| 200 | ||
| 201 | function damage(playa,hita) | |
| 202 | local hitz = hita.Name | |
| 203 | local heyy = hitz | |
| 204 | if hitz == "Right Arm" then | |
| 205 | local Limb = playa:FindFirstChild("Right Arm")
| |
| 206 | local ters = playa:FindFirstChild('Torso')
| |
| 207 | if Limb and ters then | |
| 208 | if ters:FindFirstChild('Right Shoulder') then ters["Right Shoulder"]:Destroy() end
| |
| 209 | for i,v in pairs(Limb:GetChildren()) do | |
| 210 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
| |
| 211 | v:Destroy() | |
| 212 | end | |
| 213 | end | |
| 214 | Limb.CFrame = ters.CFrame * CFrame.new(1.5, 0, 0) | |
| 215 | local Joint = Instance.new("Glue")
| |
| 216 | Joint.Name = "RightShoulder" | |
| 217 | Joint.Part0 = ters | |
| 218 | Joint.Part1 = Limb | |
| 219 | Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 220 | Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 221 | Joint.Parent = ters | |
| 222 | ||
| 223 | local B = Instance.new("Part")
| |
| 224 | B.TopSurface = 0 | |
| 225 | B.BottomSurface = 0 | |
| 226 | B.formFactor = "Symmetric" | |
| 227 | B.Size = Vector3.new(1, 1, 1) | |
| 228 | B.Transparency = 1 | |
| 229 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 230 | B.Parent = playa | |
| 231 | local W = Instance.new("Weld")
| |
| 232 | W.Part0 = Limb | |
| 233 | W.Part1 = B | |
| 234 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 235 | W.Parent = Limb | |
| 236 | end | |
| 237 | elseif hitz == "Left Arm" then | |
| 238 | local Limb = playa:FindFirstChild("Left Arm")
| |
| 239 | local ters = playa:FindFirstChild('Torso')
| |
| 240 | if Limb and ters then | |
| 241 | if ters:FindFirstChild('Left Shoulder') then ters["Left Shoulder"]:Destroy() end
| |
| 242 | for i,v in pairs(Limb:GetChildren()) do | |
| 243 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
| |
| 244 | v:Destroy() | |
| 245 | end | |
| 246 | end | |
| 247 | Limb.CFrame = ters.CFrame * CFrame.new(-1.5, 0, 0) | |
| 248 | local Joint = Instance.new("Glue")
| |
| 249 | Joint.Name = "LeftShoulder" | |
| 250 | Joint.Part0 = ters | |
| 251 | Joint.Part1 = Limb | |
| 252 | Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 253 | Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 254 | Joint.Parent = ters | |
| 255 | local B = Instance.new("Part")
| |
| 256 | B.TopSurface = 0 | |
| 257 | B.BottomSurface = 0 | |
| 258 | B.formFactor = "Symmetric" | |
| 259 | B.Size = Vector3.new(1, 1, 1) | |
| 260 | B.Transparency = 1 | |
| 261 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 262 | B.Parent = playa | |
| 263 | local W = Instance.new("Weld")
| |
| 264 | W.Part0 = ters | |
| 265 | W.Part1 = B | |
| 266 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 267 | W.Parent = Limb | |
| 268 | end | |
| 269 | elseif hitz == "Right Leg" then | |
| 270 | local Limb = playa:FindFirstChild("Right Leg")
| |
| 271 | local ters = playa:FindFirstChild('Torso')
| |
| 272 | if Limb and ters then | |
| 273 | if ters:FindFirstChild('Right Hip') then ters["Right Hip"]:Destroy() end
| |
| 274 | for i,v in pairs(Limb:GetChildren()) do | |
| 275 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
| |
| 276 | v:Destroy() | |
| 277 | end | |
| 278 | end | |
| 279 | Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0) | |
| 280 | local Joint = Instance.new("Glue")
| |
| 281 | Joint.Name = "Right Hip" | |
| 282 | Joint.Part0 = ters | |
| 283 | Joint.Part1 = Limb | |
| 284 | Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 285 | Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 286 | Joint.Parent = ters | |
| 287 | local B = Instance.new("Part")
| |
| 288 | B.TopSurface = 0 | |
| 289 | B.BottomSurface = 0 | |
| 290 | B.formFactor = "Symmetric" | |
| 291 | B.Size = Vector3.new(1, 1, 1) | |
| 292 | B.Transparency = 1 | |
| 293 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 294 | B.Parent = playa | |
| 295 | local W = Instance.new("Weld")
| |
| 296 | W.Part0 = Limb | |
| 297 | W.Part1 = B | |
| 298 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 299 | W.Parent = Limb | |
| 300 | if playa:FindFirstChildOfClass('Humanoid') then
| |
| 301 | local hum = playa:FindFirstChildOfClass('Humanoid')
| |
| 302 | local target = playa | |
| 303 | if target:FindFirstChild('HumanoidRootPart') then
| |
| 304 | target.HumanoidRootPart:Destroy() | |
| 305 | end | |
| 306 | local found = false | |
| 307 | for i,v in pairs(stunneds) do | |
| 308 | if v == hum then | |
| 309 | found = true | |
| 310 | end | |
| 311 | end | |
| 312 | if found == false then | |
| 313 | table.insert(stunneds,hum) | |
| 314 | end | |
| 315 | end | |
| 316 | end | |
| 317 | elseif hitz == "Left Leg" then | |
| 318 | local Limb = playa:FindFirstChild("Left Leg")
| |
| 319 | local ters = playa:FindFirstChild('Torso')
| |
| 320 | if Limb and ters then | |
| 321 | if ters:FindFirstChild('Left Hip') then ters["Left Hip"]:Destroy() end
| |
| 322 | for i,v in pairs(Limb:GetChildren()) do | |
| 323 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
| |
| 324 | v:Destroy() | |
| 325 | end | |
| 326 | end | |
| 327 | Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0) | |
| 328 | Limb.CFrame = ters.CFrame * CFrame.new(-0.5, -2, 0) | |
| 329 | local Joint = Instance.new("Glue")
| |
| 330 | Joint.Name = "LeftHip" | |
| 331 | Joint.Part0 = ters | |
| 332 | Joint.Part1 = Limb | |
| 333 | Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 334 | Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 335 | Joint.Parent = ters | |
| 336 | ||
| 337 | local B = Instance.new("Part")
| |
| 338 | B.TopSurface = 0 | |
| 339 | B.BottomSurface = 0 | |
| 340 | B.formFactor = "Symmetric" | |
| 341 | B.Size = Vector3.new(1, 1, 1) | |
| 342 | B.Transparency = 1 | |
| 343 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 344 | B.Parent = playa | |
| 345 | local W = Instance.new("Weld")
| |
| 346 | W.Part0 = Limb | |
| 347 | W.Part1 = B | |
| 348 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 349 | W.Parent = Limb | |
| 350 | Limb.CanCollide = false | |
| 351 | if playa:FindFirstChildOfClass('Humanoid') then
| |
| 352 | local hum = playa:FindFirstChildOfClass('Humanoid')
| |
| 353 | local target = playa | |
| 354 | if target:FindFirstChild('HumanoidRootPart') then
| |
| 355 | target.HumanoidRootPart:Destroy() | |
| 356 | end | |
| 357 | local found = false | |
| 358 | for i,v in pairs(stunneds) do | |
| 359 | if v == hum then | |
| 360 | found = true | |
| 361 | end | |
| 362 | end | |
| 363 | if found == false then | |
| 364 | table.insert(stunneds,hum) | |
| 365 | end | |
| 366 | end | |
| 367 | end | |
| 368 | else | |
| 369 | local playa2 = playa | |
| 370 | playa.Archivable = true | |
| 371 | local playa = playa:Clone() | |
| 372 | playa.Archivable = false | |
| 373 | playa2:Destroy() | |
| 374 | playa.Parent = workspace | |
| 375 | local Gibs = game.Workspace | |
| 376 | print(playa) | |
| 377 | local Torso = playa.Torso | |
| 378 | local Head = playa:FindFirstChild("Head")
| |
| 379 | local function Scan(ch) | |
| 380 | local e | |
| 381 | for e = 1,#ch do | |
| 382 | Scan(ch[e]:GetChildren()) | |
| 383 | if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then | |
| 384 | ch[e]:remove() | |
| 385 | end | |
| 386 | end | |
| 387 | end | |
| 388 | Scan(playa:GetChildren()) | |
| 389 | if playa:FindFirstChild('HumanoidRootPart') then
| |
| 390 | playa:FindFirstChild('HumanoidRootPart'):Destroy()
| |
| 391 | end | |
| 392 | local hum2 = playa:FindFirstChildOfClass("Humanoid")
| |
| 393 | ||
| 394 | ||
| 395 | if hum2 ~= nil then | |
| 396 | hum2.Name = "Humanoid2" | |
| 397 | hum2.PlatformStand = true | |
| 398 | hum2.Health = 0 | |
| 399 | end | |
| 400 | local ch = playa:GetChildren() | |
| 401 | local i | |
| 402 | for i = 1,#ch do | |
| 403 | if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then | |
| 404 | ch[i]:remove() | |
| 405 | end | |
| 406 | end | |
| 407 | ||
| 408 | if Head then | |
| 409 | local Neck = Instance.new("Weld")
| |
| 410 | Neck.Name = "Neck" | |
| 411 | Neck.Part0 = Torso | |
| 412 | Neck.Part1 = Head | |
| 413 | Neck.C0 = CFrame.new(0, 1.5, 0) | |
| 414 | Neck.C1 = CFrame.new() | |
| 415 | Neck.Parent = Torso | |
| 416 | end | |
| 417 | local Limb = playa:FindFirstChild("Right Arm")
| |
| 418 | if Limb then | |
| 419 | ||
| 420 | Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0) | |
| 421 | local Joint = Instance.new("Glue")
| |
| 422 | Joint.Name = "RightShoulder" | |
| 423 | Joint.Part0 = Torso | |
| 424 | Joint.Part1 = Limb | |
| 425 | Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 426 | Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 427 | Joint.Parent = Torso | |
| 428 | ||
| 429 | local B = Instance.new("Part")
| |
| 430 | B.TopSurface = 0 | |
| 431 | B.BottomSurface = 0 | |
| 432 | B.formFactor = "Symmetric" | |
| 433 | B.Size = Vector3.new(1, 1, 1) | |
| 434 | B.Transparency = 1 | |
| 435 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 436 | B.Parent = playa | |
| 437 | local W = Instance.new("Weld")
| |
| 438 | W.Part0 = Limb | |
| 439 | W.Part1 = B | |
| 440 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 441 | W.Parent = Limb | |
| 442 | end | |
| 443 | local Limb = playa:FindFirstChild("Left Arm")
| |
| 444 | if Limb then | |
| 445 | ||
| 446 | Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0) | |
| 447 | local Joint = Instance.new("Glue")
| |
| 448 | Joint.Name = "LeftShoulder" | |
| 449 | Joint.Part0 = Torso | |
| 450 | Joint.Part1 = Limb | |
| 451 | Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 452 | Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 453 | Joint.Parent = Torso | |
| 454 | ||
| 455 | local B = Instance.new("Part")
| |
| 456 | B.TopSurface = 0 | |
| 457 | B.BottomSurface = 0 | |
| 458 | B.formFactor = "Symmetric" | |
| 459 | B.Size = Vector3.new(1, 1, 1) | |
| 460 | B.Transparency = 1 | |
| 461 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 462 | B.Parent = playa | |
| 463 | local W = Instance.new("Weld")
| |
| 464 | W.Part0 = Limb | |
| 465 | W.Part1 = B | |
| 466 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 467 | W.Parent = Limb | |
| 468 | end | |
| 469 | local Limb = playa:FindFirstChild("Right Leg")
| |
| 470 | if Limb then | |
| 471 | ||
| 472 | Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0) | |
| 473 | local Joint = Instance.new("Glue")
| |
| 474 | Joint.Name = "RightHip" | |
| 475 | Joint.Part0 = Torso | |
| 476 | Joint.Part1 = Limb | |
| 477 | Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 478 | Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 479 | Joint.Parent = Torso | |
| 480 | ||
| 481 | local B = Instance.new("Part")
| |
| 482 | B.TopSurface = 0 | |
| 483 | B.BottomSurface = 0 | |
| 484 | B.formFactor = "Symmetric" | |
| 485 | B.Size = Vector3.new(1, 1, 1) | |
| 486 | B.Transparency = 1 | |
| 487 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 488 | B.Parent = playa | |
| 489 | local W = Instance.new("Weld")
| |
| 490 | W.Part0 = Limb | |
| 491 | W.Part1 = B | |
| 492 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 493 | W.Parent = Limb | |
| 494 | end | |
| 495 | local Limb = playa:FindFirstChild("Left Leg")
| |
| 496 | if Limb then | |
| 497 | ||
| 498 | Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0) | |
| 499 | local Joint = Instance.new("Glue")
| |
| 500 | Joint.Name = "LeftHip" | |
| 501 | Joint.Part0 = Torso | |
| 502 | Joint.Part1 = Limb | |
| 503 | Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 504 | Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 505 | Joint.Parent = Torso | |
| 506 | ||
| 507 | local B = Instance.new("Part")
| |
| 508 | B.TopSurface = 0 | |
| 509 | B.BottomSurface = 0 | |
| 510 | B.formFactor = "Symmetric" | |
| 511 | B.Size = Vector3.new(1, 1, 1) | |
| 512 | B.Transparency = 1 | |
| 513 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
| 514 | B.Parent = playa | |
| 515 | local W = Instance.new("Weld")
| |
| 516 | W.Part0 = Limb | |
| 517 | W.Part1 = B | |
| 518 | W.C0 = CFrame.new(0, -0.5, 0) | |
| 519 | W.Parent = Limb | |
| 520 | end | |
| 521 | --[ | |
| 522 | local Bar = Instance.new("Part")
| |
| 523 | Bar.TopSurface = 0 | |
| 524 | Bar.BottomSurface = 0 | |
| 525 | Bar.formFactor = "Symmetric" | |
| 526 | Bar.Size = Vector3.new(1, 1, 1) | |
| 527 | Bar.Transparency = 1 | |
| 528 | Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0) | |
| 529 | Bar.Parent = playa | |
| 530 | local Weld = Instance.new("Weld")
| |
| 531 | Weld.Part0 = Torso | |
| 532 | Weld.Part1 = Bar | |
| 533 | Weld.C0 = CFrame.new(0, 0.5, 0) | |
| 534 | Weld.Parent = Torso | |
| 535 | --]] | |
| 536 | playa.Parent = Gibs | |
| 537 | game.Debris:AddItem(playa, 12) | |
| 538 | end | |
| 539 | end | |
| 540 | ||
| 541 | ||
| 542 | function calculate() | |
| 543 | if leftarm and chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Left Shoulder") and chr:FindFirstChild('Left Arm') then
| |
| 544 | local Head = plr.Character.Head | |
| 545 | local RightShoulder = plr.Character.Torso["Left Shoulder"] | |
| 546 | local RightArm = plr.Character["Left Arm"] | |
| 547 | local MousePosition = mou.Hit.p | |
| 548 | local ToMouse = (MousePosition - Head.Position).unit | |
| 549 | local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0))) | |
| 550 | local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((-Head.Size.X / 2) + (-RightArm.Size.X / 2)), ((-Head.Size.Y / 2) - (-RightArm.Size.Z / 2)), 0))) | |
| 551 | local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(-1 ,0, -1)).unit | |
| 552 | local Look = (Head.CFrame.lookVector * Vector3.new(-1, 0, -1)).unit | |
| 553 | local LateralAngle = math.acos(ToMouseRightArm:Dot(Look)) | |
| 554 | if tostring(LateralAngle) == "-1.#IND" then | |
| 555 | LateralAngle = 0 | |
| 556 | end | |
| 557 | local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm) | |
| 558 | --[[ | |
| 559 | if LateralAngle > (math.pi / 2) then | |
| 560 | LateralAngle = (math.pi / 2) | |
| 561 | if chr:FindFirstChild('Torso') then
| |
| 562 | local Torso = chr.Torso | |
| 563 | local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p) | |
| 564 | if Point.Z > 0 then | |
| 565 | if Point.X > 0 then | |
| 566 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0) | |
| 567 | elseif Point.X < 0 then | |
| 568 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0) | |
| 569 | end | |
| 570 | end | |
| 571 | end | |
| 572 | end | |
| 573 | ]]-- | |
| 574 | print(LateralAngle) | |
| 575 | warn(math.pi / 2) | |
| 576 | if Cross.Y < 0 then | |
| 577 | LateralAngle = -LateralAngle | |
| 578 | end | |
| 579 | return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2)) | |
| 580 | elseif chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Right Shoulder") and chr:FindFirstChild('Right Arm') then
| |
| 581 | local Head = plr.Character.Head | |
| 582 | local RightShoulder = plr.Character.Torso["Right Shoulder"] | |
| 583 | local RightArm = plr.Character["Right Arm"] | |
| 584 | local MousePosition = mou.Hit.p | |
| 585 | local ToMouse = (MousePosition - Head.Position).unit | |
| 586 | local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0))) | |
| 587 | local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0))) | |
| 588 | local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit | |
| 589 | local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit | |
| 590 | local LateralAngle = math.acos(ToMouseRightArm:Dot(Look)) | |
| 591 | if tostring(LateralAngle) == "-1.#IND" then | |
| 592 | LateralAngle = 0 | |
| 593 | end | |
| 594 | local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm) | |
| 595 | if LateralAngle > (math.pi / 2) then | |
| 596 | LateralAngle = (math.pi / 2) | |
| 597 | if chr:FindFirstChild('Torso') then
| |
| 598 | local Torso = chr.Torso | |
| 599 | local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p) | |
| 600 | if Point.Z > 0 then | |
| 601 | if Point.X > 0 then | |
| 602 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0) | |
| 603 | elseif Point.X < 0 then | |
| 604 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0) | |
| 605 | end | |
| 606 | end | |
| 607 | end | |
| 608 | end | |
| 609 | if Cross.Y < 0 then | |
| 610 | LateralAngle = -LateralAngle | |
| 611 | end | |
| 612 | return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2)) | |
| 613 | end | |
| 614 | end | |
| 615 | ||
| 616 | function fire() | |
| 617 | if mou.Target then | |
| 618 | local humanoid = mou.Target.Parent:FindFirstChildOfClass("Humanoid")
| |
| 619 | if not humanoid then | |
| 620 | humanoid = mou.Target.Parent.Parent:FindFirstChildOfClass("Humanoid")
| |
| 621 | end | |
| 622 | if humanoid then | |
| 623 | local coru = coroutine.wrap(function() | |
| 624 | damage(humanoid.Parent,mou.Target) | |
| 625 | end) | |
| 626 | coru() | |
| 627 | end | |
| 628 | end | |
| 629 | local beam = Instance.new("Part", workspace)
| |
| 630 | beam.BrickColor = BrickColor.new("Bright yellow")
| |
| 631 | beam.FormFactor = "Custom" | |
| 632 | beam.Material = "Neon" | |
| 633 | beam.Transparency = 0.25 | |
| 634 | beam.Anchored = true | |
| 635 | beam.Locked = true | |
| 636 | beam.CanCollide = false | |
| 637 | local distance = (obj4.CFrame.p - mou.Hit.p).magnitude | |
| 638 | beam.Size = Vector3.new(0.2, 0.2, distance) | |
| 639 | beam.CFrame = CFrame.new(obj4.CFrame.p, mou.Hit.p) * CFrame.new(0, 0, -distance / 2) | |
| 640 | game:GetService("Debris"):AddItem(beam, 0.05)
| |
| 641 | local sound = Instance.new('Sound',obj4)
| |
| 642 | - | sound.SoundId = 'rbxassetid://139593133' |
| 642 | + | sound.SoundId = 'rbxassetid://142347633' |
| 643 | sound.Volume = 3 | |
| 644 | sound.EmitterSize = 40 | |
| 645 | sound.MaxDistance = 450 | |
| 646 | sound:Play() | |
| 647 | game:GetService("Debris"):AddItem(beam, sound.TimeLength)
| |
| 648 | end | |
| 649 | ||
| 650 | ---------------------------[[[ SCRIPT ]]]--------------------------- | |
| 651 | if chr:FindFirstChild('Left Arm') == nil or chr:FindFirstChild('Torso') == nil or chr.Torso:FindFirstChild('Left Shoulder') == nil then
| |
| 652 | leftarm = false | |
| 653 | end | |
| 654 | local weldas = Instance.new('Weld',obj2)
| |
| 655 | if leftarm and chr:FindFirstChild('Left Arm') then
| |
| 656 | weldas.Part0 = obj2 | |
| 657 | weldas.Part1 = chr["Left Arm"] | |
| 658 | weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180)) | |
| 659 | elseif chr:FindFirstChild('Right Arm') then
| |
| 660 | weldas.Part0 = obj2 | |
| 661 | weldas.Part1 = chr["Right Arm"] | |
| 662 | weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180)) | |
| 663 | end | |
| 664 | ||
| 665 | ||
| 666 | if leftarm and chr:FindFirstChild('Left Arm') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild('Left Shoulder') then
| |
| 667 | chr:FindFirstChild('Left Arm').AncestryChanged:connect(function(me,par)
| |
| 668 | if par ~= chr and chr:FindFirstChild('Right Arm') then
| |
| 669 | if obj2 and obj2:FindFirstChildOfClass('Weld') then
| |
| 670 | obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
| |
| 671 | end | |
| 672 | leftarm = false | |
| 673 | end | |
| 674 | end) | |
| 675 | chr.Torso:FindFirstChild('Left Shoulder').AncestryChanged:connect(function(me,par)
| |
| 676 | if par ~= chr:FindFirstChild('Torso') and chr:FindFirstChild('Right Arm') then
| |
| 677 | if obj2 and obj2:FindFirstChildOfClass('Weld') then
| |
| 678 | obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
| |
| 679 | end | |
| 680 | end | |
| 681 | leftarm = false | |
| 682 | end) | |
| 683 | elseif leftarm then | |
| 684 | if obj2 and obj2:FindFirstChildOfClass('Weld') and chr:FindFirstChild('Right Arm') then
| |
| 685 | obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
| |
| 686 | end | |
| 687 | end | |
| 688 | ||
| 689 | mou.KeyDown:connect(function(key) | |
| 690 | if key == string.lower(curkey) then | |
| 691 | active = not active | |
| 692 | end | |
| 693 | end) | |
| 694 | ||
| 695 | plr.Chatted:connect(function(msg) | |
| 696 | if string.lower(string.sub(msg,1,5)) == "!bind" then | |
| 697 | curkey = string.lower(string.sub(msg,7,7)) | |
| 698 | notify([[Changed key for equip/unequip to "]]..curkey..[[".]],false) | |
| 699 | end | |
| 700 | end) | |
| 701 | ||
| 702 | game:GetService('RunService').Stepped:connect(function()
| |
| 703 | if active and chr:FindFirstChild('Torso') then
| |
| 704 | if leftarm then | |
| 705 | chr.Torso["Left Shoulder"].C0 = calculate() | |
| 706 | else | |
| 707 | chr.Torso["Right Shoulder"].C0 = calculate() | |
| 708 | end | |
| 709 | weldas.Part1 = chr["Right Arm"] | |
| 710 | weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180)) | |
| 711 | elseif chr:FindFirstChild('Torso') and (chr.Torso:FindFirstChild('Left Shoulder') or chr.Torso:FindFirstChild('Right Shoulder')) then
| |
| 712 | if leftarm then | |
| 713 | chr.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0)*CFrame.Angles(0,-math.pi/2,0) | |
| 714 | else | |
| 715 | chr.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0)*CFrame.Angles(0,math.pi/2,0) | |
| 716 | end | |
| 717 | weldas.Part1 = chr.Torso | |
| 718 | weldas.C0 = CFrame.new(-1,0,-1)*CFrame.Angles(math.rad(-90),0,0) | |
| 719 | end | |
| 720 | for i,v in pairs(stunneds) do | |
| 721 | v.PlatformStand = true | |
| 722 | end | |
| 723 | end) | |
| 724 | ||
| 725 | mou.Button1Down:connect(function() | |
| 726 | if active then | |
| 727 | fire() | |
| 728 | end | |
| 729 | end) | |
| 730 | ||
| 731 | notify([[Chat "!bind [key]" to bind a different key to equip/unequip. Current key is "f".]],false) |