Hi, i have A Script that while true loops to change the size of an image in a GUI based on an IntValue object. This is the script:
while true do
wait()
local Image = script.Parent.Aim1
local player = game.Players.LocalPlayer
local Val3 = game.Workspace[player.Name.."F"][player.Name.."F"]:WaitForChild("CrossairSize")
Image.Size = UDim2.new(0 ..Val3.Value.. 0 ..Val3.Value)
end
What you are doing right now is putting all the values together, that’s why you get such output. What you need to do is add comas.
while true do
wait()
local Image = script.Parent.Aim1
local player = game.Players.LocalPlayer
local Val3 = game.Workspace[player.Name.."F"][player.Name.."F"]:WaitForChild("CrossairSize")
Image.Size = UDim2.new(0, Val3.Value, 0, Val3.Value)
end
I also suggest using UDim2.fromScale() because you will be setting the scale size value of the GUI which means that the GUI will be scaled properly for devices.