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 Create a TextBox GUI, that the player can enter their asset id in, and it will change an ImageLabel GUI to the id they entered in.
What is the issue? Include screenshots / videos if possible!
The ID Prints 16 when I enter the ID of 4637746375
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried and looked about subtracted from IntValues but I did not understand any of it.
-- Place this code in a LocalScript inside a TextBox
local textBox = script.Parent
-- Initialize the state of the textBox
textBox.ClearTextOnFocus = true
textBox.Text = ""
local function onFocused()
textBox.Text = ""
end
local function onFocusLost(enterPressed, inputObject)
if enterPressed then
local ID = textBox.Text - 1
local assetlink = "http://www.roblox.com/asset/?id="
print(ID)
--ID = - 1
script.Parent.Parent.Parent.ImageLabel.Image = "http://www.roblox.com/asset/?id=".. ID
else
-- The player stopped editing without pressing Enter
textBox.Text = ""
end
end
textBox.FocusLost:Connect(onFocusLost)
textBox.Focused:Connect(onFocused)