Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Do You Make Objects Fly when you hit space bar or a key?

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.

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

2 comments

0

Ask someone else for more of the script or..... Go to roblox wiki and search "CFrame" and "Vector3" Vector3 for resizing CFrame for positioning.

0

Hope I helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.