I am trying to make this move "Chargeable" so basically I just want the part to continue to grow while you have left click pressed down. Then when you lift up your left click, the part will go forward.
Here is the code I have so far
local Player = script.Parent.Parent.Parent
local bin = script.Parent
local Torso = Player.Character:WaitForChild("Torso")
local Mouse = Player:GetMouse()
enabled = true
debounce = true
function onButton1Down(mouse)
wait(.2)
local x = script.Part:Clone()
x.Parent = game.Workspace
x.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,0,-10)
x.Size = Vector3.new(10,10,0)
x.Anchored = false
x.CanCollide = false
local Velocity = Instance.new("BodyVelocity", x)
Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
Velocity.velocity = Player.Character.Torso.CFrame.lookVector*40
fd = script.Firedamage:Clone()
fd.Parent = x
wait(5)
x:remove()
wait(5)
end
function onS(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onS)

1 comment
It doesn't work fully. It doesn't make the part increase in size and it prints errors. I added the bool value like i was supposed to.