I’m trying to have a GUI’s position changed based on an IntValue, this is what I have:
MoodValue = game.Workspace.Values.KingMoodValue --is a value from 0-1 so it is compatible with the gui position
MoodValue:GetPropertyChangedSignal("Value"):Connect(function()
local FaceIcon = script.Parent
FaceIcon.Position = Vector2.new "{MoodValue, 0},{0.5, 0}" --this line is where the format issue is
end)
how would I format this so FaceIcon’s position is set to MoodValue?
local MoodValue = workspace:WaitForChild("Values"):WaitForChild("KingMoodValue")
MoodValue:GetPropertyChangedSignal("Value"):Connect(function()
local FaceIcon = script.Parent
local Value = MoodValue.Value
FaceIcon.Position = UDim2.new(100/Value, 0, 0.5, 0)
end)
That wouldn’t work, saying as the mood value could only be 0 or 1 depending on where they want the position to be. You could do the same thing with this code using a NumberValue and use a number from 0 to 1, but that’s less ethical than 0 to 100 in an IntValue.
Didn’t see it lol. Wasn’t really paying attention to the notes in the code.
And my original concept was to use 100/Value since I didn’t think they’d use 0. But, I wasn’t thinking many things through lol. I’m kinda sick (covid sucks )
My brain hasn’t been working if I’m being completely honest lol