Hi, basically I want to shorten the numbers without affecting the number directly, for example:
0.43445434 becomes only 0.43. I don’t know if shortening is the correct word for what I want to do, I just want to shorten the numbers. The following script is to make a SliderGui of anything, only that I want to add a winged text that takes the number of X out of the position, only that it is too long and I want to shorten it (or is it abbreviated?).
local Button = script.Parent:FindFirstChild("ImageButton")
local Fondo = script.Parent:FindFirstChild("Fondo")
local Nivel = script.Parent:FindFirstChild("Nivel")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Fire = ReplicatedStorage:WaitForChild("ConfiguracionGeneral"):WaitForChild("Change_configuration")
local text = script.Parent.Parent:WaitForChild("NivelDeBrillo")
local Enabled = false
local Debounce = false
local TimeWait = 0.05
local tweenInfo = TweenInfo.new(TimeWait)
Button.MouseButton1Down:Connect(function()
if not Debounce then
Debounce = true
wait(TimeWait)
Enabled = true
Debounce = false
end
end)
UserInputService.InputChanged:Connect(function()
if Enabled == true then
local MousePos = UserInputService:GetMouseLocation() + Vector2.new(0, 36)
local RelvPos = MousePos-Fondo.AbsolutePosition
local Precent = math.clamp(RelvPos.X/Fondo.AbsoluteSize.X, 0, 1)
Button.Position = UDim2.new(Precent, 0, 0, 5)
Nivel.Size = UDim2.new(Precent, 0, 0.88, 0)
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and Enabled == true then
Enabled = false
text.Text = Button.Position.X.Scale
print(Button.Position.X.Scale)
--Fire:FireServer("BrilloVol", "BrilloVolumen10")
end
end)