Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tool = Instance.new("Tool")
- Part = Instance.new("Part")
- Part.Name = "Handle"
- Part.Parent = Tool
- Tool.Parent = owner.Character
- Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = Part
- Mesh.MeshId = "http://www.roblox.com/asset/?id=6080721391"
- Mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
- Tool.Grip = CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(math.rad(-45),0,0)
- wait(0.5)
- Part.Size = Vector3.new(1.474, 1.474, 9.361)
- Part.BrickColor = BrickColor.new(1, 1, 1)
- local E = Instance.new("RemoteEvent", owner.Character)
- E.Name = "The"
- Bullet = Instance.new("Part", owner.Character)
- Bullet.Position = Vector3.new(1000000,1000000,1000000)
- Bullet.Anchored = true
- Bullet.CanCollide = false
- wait(0.1)
- NLS([[
- mouse = owner:GetMouse()
- local E = owner.Character:WaitForChild("The")
- mouse.Button1Down:Connect(function()
- local position = mouse.Hit.Position
- E:FireServer(position)
- end)
- ]],owner.PlayerGui)
- E.OnServerEvent:Connect(function(player, position)
- local origin = Part.Position * Part.CFrame.LookVector * 1.5
- local direction = (position - origin).Unit*300
- local result = game.Workspace:Raycast(origin, direction)
- local intersection = result and result.Position or origin + direction
- local distance = (origin - intersection).Magnitude
- local bullet_clone = Bullet:Clone()
- bullet_clone.Size = Vector3.new(4.3085, 4.3085, distance)
- bullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2)
- bullet_clone.Parent = game.Workspace
- if result then
- local part = result.Instance
- local humanoid = part.Parent:FindFirstChild("Humanoid") or part.Parent.Parent:FindFirstChild("Humanoid")
- if humanoid then
- if humanoid ~= owner.Character.Humanoid then
- humanoid.RootPart:Destroy()
- end
- end
- end
- wait(0.25)
- bullet_clone:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement