I believe the problem lies where I have to change the position of the cylinder as a move, is there any possible way of fixing it?
local beam = script.Parent.Parent.Parent.Beam
local online = true
local button = script.Parent.CD
local debounce = false
local distance = 16
local red = Color3.fromRGB(196, 40, 28)
local green = Color3.fromRGB(46, 204, 113)
local busy = Color3.fromRGB(44, 62, 80)
local stSize, enSize = Vector3.new(0.05, 0.34, 0.68), Vector3.new(20.3, 0.34, 0.68)
local stPos, enPos = Vector3.new(167.036, 3.199, 81.318), Vector3.new(167.036, 3.199, 91.443)
button.MouseClick:Connect(function()
if debounce == false then
debounce = true
button.MaxActivationDistance = 0 -- Disable Click
button.Parent.Color = busy -- Set Colour
if online == true then
for i=0,1,0.05 do
beam.Size = beam.Size:Lerp(stSize, i)
beam.Position = beam.Position:Lerp(stPos, i)
wait(0.1)
end
online = false
button.Parent.Color = green
else
for i=0,1,0.1 do
beam.Size = beam.Size:Lerp(enSize, i)
beam.Position = beam.Position:Lerp(enPos, i)
wait(0.05)
end
online = true
button.Parent.Color = red
end
button.MaxActivationDistance = distance -- Reset Click
debounce = false
end
end)

4 comments
Do you have discord?
Yes I do
Wouldn't have minded you giving it. Anyway's what is it.
I'm on the Scripting Helpers discord