Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

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

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

--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

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. fireboltofdeath 635 — 10y
0
Hope I helped! fireboltofdeath 635 — 10y
Ad

Answer this question