What do you want to achieve? I have an ImageLabel with a NumberValue inside, I made it if you go close to someone it gives the value +5 every second, I have a GUI aswell, and I want to make it that the GUI tweens by the NumberValue.
What is the issue? I don’t have any idea on how to do this, I’m not a very good scripter.
Also this is the part of my script where I need help!
What solutions have you tried so far? I don’t tried anything yet, I don’t know how to do this, I tried to look after it in the devforum, but I found nothing!
Sorry if its hard to understand, my English isnt good!
Hello there! You can use TweenService to tween your instances.
You can also use the GetPropertyChangedSignal event to detect when the value of MoraleValue change. Once it changes, you can tween your frames to the desired position.
Hey! thanks for your answer, Sorry, but can you make an example on how I can do that in a script?
I don’t need full script, just an example if you have time.
Thank you!
local TweenService = game:GetService("TweenService")
local NumberValue = Instance.new("NumberValue") -- Or whatever your "MoraleValue" variable is
local Gui = script.Parent -- Or whatever your "gui" variable is
NumberValue:GetPropertyChangedSignal("Value"):Connect(function()
TweenService:Create(Gui.Frame, TweenInfo.new(), {
Position = -- [THE POSITION YOU WANT]
})
end)