You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
i want to get the percent of an guiobject relatively to its parent -
What is the issue? Include screenshots / videos if possible!
does not work right -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i fond lerp but that does not work
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local offsetx = script.Parent.Picker.AbsolutePosition.X
local mouse = game.Players.LocalPlayer:GetMouse()
local runservice = game:GetService("RunService")
runservice.RenderStepped:Connect(function()
script.Parent.Picker.Position = UDim2.fromOffset(mouse.X-offsetx,0)
end)
runservice.Heartbeat:Connect(function()
local thenumber = script.Parent.Picker.AbsolutePosition.X / script.Parent.AbsoluteSize.X-----
print(thenumber)--should give a value 0 to 1
script.Parent.TheNumber.Value = thenumber
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.