Throwing tool error

i’m a very beginner scripter and tried to make a script where if you are holding the tool and you click, it sends a projectile to where ur mouse is. heres the script.

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local tool = script.Parent
local brick = tool.Handle

mouse.Button1Down:Connect(function()

  local newbrick = brick:Clone()
  newbrick.Parent = tool
  newbrick.Position = brick.Position
  
  local bodyvelocity = Instance.new("BodyVelocity")
  bodyvelocity.Parent = newbrick
  bodyvelocity.Velocity = Vector3.new(mouse.X,mouse.Y)
  wait(1)
  bodyvelocity:Destroy()

end)

im trying to make a script similar to the one in Runker 51, take a look

vid might not be good quality since i just uploaded it.

some help would be nice!

1 Like

I never worked with Body…s, but this shall do what you’re looking for:

local plr = game.Players.LocalPlayer
local m = plr:GetMouse()
local Cframe = m.Hit
local vector3 = m.Hit.position or m.Hit.p

script.Parent.Activated:Connect(function()
	local Projectile = script.Parent.Handle:Clone()
	Projectile.Parent = script.Parent
	Projectile.Position = Vector3.new(script.Parent.Handle.Position)
	
	local BV = Instance.new("BodyVelocity")
	BV.Parent = Projectile
	BV.Velocity = Vector3.new(vector3)
	wait(1)
	Projectile:Destroy() -- BV:Destroy()
end)

I’d like if you gave info on how the tool looks like. (A picture of it for example.)

And sorry for being late to reply to your post.

Screenshot_198

also, this pops up.

Screenshot_202 Screenshot_201

Simply remove m.Hit.position or.

still doesnt work…???

I’m currently testing a semi-replication of the tool, wait until i give a response, or someone else does.

1 Like

This is really taking longer than what i thought, i have “no” idea on how to do this, but use Doomspire Brickbattle(The one owned by GFink, which has the slingshot) and use the slingshot script, you can modificate the model etc. I will try on my own to do this, so, keep waiting…

1 Like

Here it is: for DevForum user. - Roblox

There is one issue which is that the brick which is not gonna always be in the same direction. This will depend on where you’ll throw it at/click.

2 Likes

awesome! thank you so much!!!