So I can't make this work, and I keep getting an error. Does "CFrame.new()" even work in a local script?
code [local script]:
local Tool = script.Parent.Parent
local debounce = false
local fireRate = 0.2
local distance = 30
Tool.Equipped:Connect(function(Mouse)
if not debounce then
debounce = true
Mouse.Button1Down:Connect(function()
local brick = Instance.new('Part', workspace)
brick.Size = Vector3.new(0.75, 0.75, 0.75)
brick.CFrame = script.Parent.CFrame
repeat
brick.Anchored = true
brick.CFrame = brick.CFrame + Vector3.new(0, 0, 3)
wait(0.05)
until((brick.Position - script.Parent.Position).magnitude >= distance)
brick.Anchored = false
end)
wait(fireRate)
debounce = false
end
end)
If this also happens to you let me know and if you figured out how to fix it also let me know. Thanks, bye! :P

4 comments
If there's something I need to add or remove then yah... just tell me
Could you tell us the error atleast....
IDK
It doesn't give me an error actually, it just always goes backward, but it goes backward in position not CFrame