I was trying to make a sort of throb effect for my UI to make it get larger and smaller over time based on a variable. Can somebody explain why this localScript is not working in this situation?
local scale = 1
local UpOrDown = nil
while true do
wait(1)
if scale ==1 then
UpOrDown = "Up"
elseif scale==5 then
UpOrDown = "Down"
end
if UpOrDown == "Up" then
local currentX = script.Parent.Size.X
local currentY = script.Parent.Size.Y
script.Parent.Size = UDim2.new(0, currentX+10, 0, currentY+10)
elseif UpOrDown == "Down" then
local currentX = script.Parent.Size.X
local currentY = script.Parent.Size.Y
script.Parent.Size = UDim2.new(0,currentX+10,0,currentY+10)
end
end
The file for testing
Random Message Generator.rbxl (27.9 KB)