Here is my script:
local db = true
game.ReplicatedStorage.Events.LaserAttack.OnServerEvent:Connect(function(player, mouse)
if db == true then
db = false
local sizeIncrease = Vector3.new(2, 0, 0)
local laser = game.ReplicatedStorage.Laser:Clone()
local rotatedCFrame = CFrame.Angles(0, math.rad(90), 0)
laser.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position, mouse)
laser.CFrame = laser.CFrame:ToWorldSpace(rotatedCFrame)
laser.Parent = game.Workspace.Lasers
for i = 1, 100 do
laser.Size = laser.Size + sizeIncrease
wait()
end
wait(3)
db = true
end
end)
When I tested it, the result is my part going both ways, how do I fix that?

2 comments
Very useful, thank you so much!
no problem