Does the code we presented not work, or is it just not suitable?
Cuz you can just save the new size value to a variable or something when you manage to detect it changing.
I made it so when the exp gets more than 1, it times a number to use tweening for a good size UI. I used both your methods and tried to use print() for them, but it would print nothing. When I tested it, it worked for only 1 time but it would stay stuck there. It also wasn’t what I wanted. Heres the code:
elseif exp.Value > (MaxExp.Value - (MaxExp.Value - exp.Value)) then
plrExp.Changed:Connect(function(ChangedProperty)
if ChangedProperty == "Size" then
local newMth = plrExp.Size.X.Offset
print(newMth)
exp.Value *= (newMth + add)
plrExp:TweenSize(UDim2.new(0, (exp.Value * (mth + add)),1.129, 0), "Out", "Linear", 0.5, false)
end
end)
I am not sure what the issue can be. I tested it myself with the same code I wrote here and it worked everytime I changed the size. Maybe there could be some problem with your code, but I don’t see anything problematic.
local Gui = script:FindFirstAncestorOfClass("ScreenGui")
local Frame = Gui:FindFirstChildOfClass("Frame")
local Resized = Frame:GetPropertyChangedSignal("AbsoluteSize")
Resized:Connect(function()
print("The frame's size has changed!")
end)
Oi, back at it again with this case.
You can make a variable to store the size value in. You can use it to check for changes and save it for later:
(I have tested this and it works)
local gui = script.Parent -- This will refer to your gui object
local lastOffset_X = gui.Size.X.Offset -- Set the value to the current gui size right away to act as the base value
gui.Changed:Connect(function(property)
if property == "Size" then
if gui.Size.X.Offset ~= lastOffset_X then -- if our new size X offset is not equal to the saved one, overwrite it with the new one
print("Last Size: " .. lastOffset_X .. " New Size: " .. gui.Size.X.Offset)
lastOffset_X = gui.Size.X.Offset -- overwriting
end
end
end)