Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- LAZ0R H4ND MADE BY THE ONE AND ONLY X1OP.
- Instructions: to toggle press R and to shoot a ray just click.
- It needs to be a localscript.
- Have fun!
- ]]
- local Player=game:GetService("Players").LocalPlayer
- local RayColor=BrickColor.new("Tan")
- local Mouse=Player:GetMouse()
- local Damage=25
- local infDamage=true
- local Render=game:GetService("RunService").RenderStepped
- local function BEGIN(Character)
- local WhenYouStop={}
- local MouseConnection
- local RightArm=Character:FindFirstChild("Right Arm")
- if RightArm==nil then return end
- local Torso=Character:FindFirstChild("Torso")
- if Torso==nil then return end
- local RightShoulder
- if Torso then
- RightShoulder=Torso:FindFirstChild("Right Shoulder")
- if RightShoulder then
- RightShoulder=RightShoulder:clone()
- end
- end
- local RayPowers=false
- local function START()
- if RayPowers==false then
- local Weld=Instance.new("Weld",Character)
- Weld.Part0=Torso
- Weld.Part1=RightArm
- MouseConnection=Mouse.Button1Down:connect(function()
- local function RayCast(Origin,Destination,Character)
- local togo=(Destination-Origin).unit
- local ray=Ray.new( Origin, (togo*999) )
- local HitPart,HitPoint=Workspace:FindPartOnRay(ray,Character)
- coroutine.wrap(function()
- local d=Instance.new("Sound",Character.Torso)
- d.SoundId="http://www.roblox.com/asset/?id=130791043"
- d.Volume=2
- d:Play()
- wait(1)
- d:Destroy()
- end)()
- if HitPart then
- for i,v in pairs(HitPart.Parent:GetChildren()) do
- if v.className=="Humanoid" then
- if infDamage then
- v.Health=0
- else
- v.Health=v.Health-Damage
- end
- end
- end
- if HitPart.Parent:IsA("Hat") then
- HitPart:Destroy()
- end
- local prt=Instance.new("Part",Workspace)
- prt.BrickColor=RayColor
- prt.FormFactor="Custom"
- prt.Anchored=true
- prt.CanCollide=false
- prt.Size=Vector3.new(RightArm.Size.x,(HitPoint-Origin).magnitude,RightArm.Size.z)
- prt.CFrame=CFrame.new((Origin+(HitPoint-Origin)*0.5),HitPoint)*CFrame.Angles(math.rad(90),0,0)
- for i = 0,1,.1 do
- prt.Transparency=i
- Render:wait()
- end
- prt:Destroy()
- end
- end
- RayCast((RightArm.CFrame*CFrame.new(0,-RightArm.Size.y/2,0)).p,Mouse.Hit.p,Character)
- end)
- table.insert(WhenYouStop,#WhenYouStop+1,Weld)
- RayPowers=true
- while RayPowers do
- Weld.C0=Torso.CFrame:inverse()*CFrame.new((Torso.CFrame*CFrame.new(Torso.Size.x/2+RightArm.Size.x/2,Torso.Size.y/2-RightArm.Size.z/2,0)).p,Mouse.Hit.p)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0,Torso.Size.z/2-RightArm.Size.y/2,0)
- Render:wait()
- end
- end
- end
- local function STOP()
- if RayPowers==true then
- if MouseConnection~=nil then
- MouseConnection:disconnect()
- end
- local Weld=LeftShoulder:clone()
- Weld.Parent=Character
- Weld.Part0=Torso
- Weld.Part1=RightArm
- for i,v in pairs(WhenYouStop) do
- if v then
- v:Destroy()
- end
- end
- RayPowers=false
- end
- end
- local NewConnection;NewConnection=Mouse.KeyDown:connect(function(key)
- if Character==nil or Character.Parent==nil then
- NewConnection:disconnect()
- return
- end
- if string.lower(key)=="r" then
- if RayPowers==true then
- pcall(STOP)
- else
- pcall(START)
- end
- end
- end)
- table.insert(MouseConnections,#MouseConnections+1,NewConnection)
- end
- pcall(BEGIN,Player.Character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement