so i was working on a rock, if you click it, the tool gets thrown, only problem is the tool goes through walls, a example:
local Event = script.Parent:WaitForChild("T_SE")
Event.OnServerEvent:Connect(function(Player, Tool, Type, MousePosition)
if Player and Tool and Type and MousePosition then
local StartPos = (Player.Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -1)).p
local Speed = (MousePosition - StartPos).Unit * 100
if Type == "ACT" then
if Tool.Name == "Rock" then
local ClonedRock = Tool.Handle:Clone()
ClonedRock.Throw:Play()
ClonedRock.Position = StartPos
ClonedRock.Velocity = Speed
ClonedRock.Parent = workspace
Tool:Destroy()
end
end
end
end)