Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- R: make random object
- F: shoot grabbed objects
- E: more distance
- Q: less distance
- ]]
- local char=game.Players.LocalPlayer.Character
- local mouse=game.Players.LocalPlayer:GetMouse()
- local weld=Instance.new("Weld",char)
- local dist=-4
- local enlarging
- local enshorting
- local tograb
- weld.Part0=char.Torso
- weld.Part1=char["Right Arm"]
- game:service("RunService").RenderStepped:connect(function()
- weld.C0=char.Torso.CFrame:inverse()*CFrame.new((char.Torso.CFrame*CFrame.new(1.5,.5,0)).p,mouse.Hit.p)*CFrame.new(0,0,-.5)*CFrame.Angles(math.rad(90),0,0)
- end)
- mouse.Button1Down:connect(function()
- if mouse.Target~=nil and tograb==nil then
- if mouse.Target.className=="Part" and mouse.Target.Name~="Base" then
- tograb=mouse.Target
- tograb.Anchored=true
- tograb.CanCollide=true
- tograb.Parent=Workspace
- end
- else
- if tograb~=nil then
- tograb.Anchored=false
- tograb=nil
- end
- end
- end)
- mouse.KeyDown:connect(function(key)
- if string.lower(key)=="r" then
- pcall(function()
- local materials={
- "Plastic","SmoothPlastic","Wood",
- "Marble","Slate","Concrete",
- "Granite","Brick","Pebble",
- "CorrodedMetal","DiamondPlate","Foil",
- "Grass","Sand","Fabric","Ice"
- }
- local prt=Instance.new("Part",Workspace)
- prt.FormFactor="Custom"
- prt.Size=Vector3.new(math.random(0.4,3),math.random(0.4,3),math.random(0.4,3))
- prt.Material=materials[math.random(1,#materials)]
- prt.BrickColor=BrickColor.new(Color3.new(math.random(1,255)/255, math.random(1,255)/255, math.random(1,255)/255))
- prt.CFrame=char["Right Arm"].CFrame*CFrame.new(0,-5,0)
- end)
- end
- if string.lower(key)=="f" then
- if tograb~=nil then
- local GO=tograb
- tograb=nil
- GO.Anchored=false
- wait()
- GO.Velocity=(mouse.Hit.p-char["Right Arm"].Position).unit*375
- end
- end
- if string.lower(key)=="e" then
- enlarging=true
- while enlarging do
- dist=dist-.5
- game:service("RunService").RenderStepped:wait()
- end
- end
- if string.lower(key)=="q" then
- enshorting=true
- while enshorting do
- dist=dist+.5
- game:service("RunService").RenderStepped:wait()
- end
- end
- end)
- mouse.KeyUp:connect(function(key)
- if string.lower(key)=="e" then
- enlarging=false
- end
- if string.lower(key)=="q" then
- enshorting=false
- end
- end)
- coroutine.wrap(function()
- while true do
- if tograb ~= nil then
- tograb.CFrame=char["Right Arm"].CFrame*CFrame.new(0,dist,0)*CFrame.Angles(math.rad(90),0,math.rad(180))
- end
- game:service("RunService").RenderStepped:wait()
- end
- end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement