I am trying to make this game where you get to throw erasers at people, and you have to hit the space bar or some key. The thing is I don't know a script that lets you throw objects. Please show me a script on this.
✓ ANSWER ACCEPTED
How Do You Make Objects Fly when you hit space bar or a key?
1 answer
✓ Accepted answer
--This is not a request site--
But....
player = script.Parent.Parent
mouse = player:GetMouse()
mouse.KeyDown:connect(function(k)
if k == "q" then
v = Instance.new("Part", game.Workspace)
v.Position = player.Character["Left Arm"].Position
--Rest of code here I WILL NOT give full code but this will insert a brick when "q" is pressed
end
end)
You will have to put in localscript in starterpack for this to work
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Ask someone else for more of the script or..... Go to roblox wiki and search "CFrame" and "Vector3" Vector3 for resizing CFrame for positioning.
Hope I helped!