Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Function Not Activating When Value Changes?

Asked by 8 years ago

Problem: The Following script will not change the size of the bar(a frame) when value changes, I have checked while playing in studio and the Value DOES change. It is a number value

Script

local Val = script.Parent.Parent:WaitForChild('MyThirst')
local Bar = script.Parent
local Size = .02 * Val.Value

Val.Changed:connect(function(NewValue)
Bar:TweenSize(UDim2.new(.02 * NewValue, 0,0.44, 0)) 
end)

I have also tried

local Val = script.Parent.Parent.MyThirst
local Bar = script.Parent
local Size = .02 * Val.Value

Val.Changed:connect(function(NewValue)
Bar:TweenSize(UDim2.new(Size, 0,0.44, 0)) 
end)

Answer this question