SHOW:
|
|
- or go back to the newest paste.
| 1 | Tool = Instance.new("Tool")
| |
| 2 | Part = Instance.new("Part")
| |
| 3 | Part.Name = "Handle" | |
| 4 | Part.Parent = Tool | |
| 5 | - | Tool.Parent = workspace.Lucas_YT111 -- replace name |
| 5 | + | Tool.Parent = owner.Character |
| 6 | Mesh = Instance.new("SpecialMesh")
| |
| 7 | Mesh.Parent = Part | |
| 8 | - | Mesh.MeshId = "http://www.roblox.com/asset/?id=12221720" |
| 8 | + | Mesh.MeshId = "http://www.roblox.com/asset/?id=6080721391" |
| 9 | - | Mesh.TextureId = "http://www.roblox.com/asset/?id=12224218" |
| 9 | + | Mesh.Scale = Vector3.new(1.5, 1.5, 1.5) |
| 10 | - | Mesh.Scale = Vector3.new(1, 1, 1) |
| 10 | + | Tool.Grip = CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(math.rad(-45),0,0) |
| 11 | - | Tool = script.Parent |
| 11 | + | wait(0.5) |
| 12 | Part.Size = Vector3.new(1.474, 1.474, 9.361) | |
| 13 | Part.BrickColor = BrickColor.new(1, 1, 1) | |
| 14 | local E = Instance.new("RemoteEvent", owner.Character)
| |
| 15 | E.Name = "The" | |
| 16 | Bullet = Instance.new("Part", owner.Character)
| |
| 17 | Bullet.Position = Vector3.new(1000000,1000000,1000000) | |
| 18 | Bullet.Anchored = true | |
| 19 | Bullet.CanCollide = false | |
| 20 | wait(0.1) | |
| 21 | NLS([[ | |
| 22 | mouse = owner:GetMouse() | |
| 23 | local E = owner.Character:WaitForChild("The")
| |
| 24 | mouse.Button1Down:Connect(function() | |
| 25 | local position = mouse.Hit.Position | |
| 26 | E:FireServer(position) | |
| 27 | end) | |
| 28 | ]],owner.PlayerGui) | |
| 29 | E.OnServerEvent:Connect(function(player, position) | |
| 30 | local origin = Part.Position * Part.CFrame.LookVector * 1.5 | |
| 31 | local direction = (position - origin).Unit*300 | |
| 32 | local result = game.Workspace:Raycast(origin, direction) | |
| 33 | ||
| 34 | local intersection = result and result.Position or origin + direction | |
| 35 | local distance = (origin - intersection).Magnitude | |
| 36 | ||
| 37 | local bullet_clone = Bullet:Clone() | |
| 38 | bullet_clone.Size = Vector3.new(4.3085, 4.3085, distance) | |
| 39 | bullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2) | |
| 40 | bullet_clone.Parent = game.Workspace | |
| 41 | if result then | |
| 42 | local part = result.Instance | |
| 43 | local humanoid = part.Parent:FindFirstChild("Humanoid") or part.Parent.Parent:FindFirstChild("Humanoid")
| |
| 44 | ||
| 45 | if humanoid then | |
| 46 | if humanoid ~= owner.Character.Humanoid then | |
| 47 | humanoid.RootPart:Destroy() | |
| 48 | end | |
| 49 | end | |
| 50 | end | |
| 51 | wait(0.25) | |
| 52 | bullet_clone:Destroy() | |
| 53 | end) |