So when I try to click with this tool to the wall, it hits the wall but doesn't stick to it. I'm trying to make it act as a sticky ball and they just fall and it shows no errors in the output. Not sure why it's not welding and now I'm lost.
Don't know if I should do weld constraint or weld for this.
Server Script in tool
local tool = script.Parent
tool.Bounce.OnServerEvent:Connect(function(player, event)
print(player)
local mouse = player:GetMouse()
local ball = tool.Handle
tool.Parent = workspace
ball.CFrame = tool.Handle.CFrame
ball.CFrame = CFrame.new(ball.Position, event)
local BV = Instance.new("BodyVelocity", ball);
BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BV.Velocity = ball.CFrame.lookVector * 50
wait(.1)
tool.Handle.BodyVelocity:Destroy()
end)
script.Parent.Handle.Touched:Connect(function(hit)
local Weld = Instance.new("WeldConstraint")
Weld.Parent = script.Parent.Handle
Weld.Part0 = hit
Weld.Part1 = script.Parent.Handle
end)
Local script
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
if workspace.FilteringEnabled then
tool.Activated:Connect(function()
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
tool.Bounce:FireServer(mouse.Hit.p)
end)
end)
end
