RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make it so it converts user input from a decal id to a image id"
-- local script local textBox = script.Parent local imageLabel = script.Parent.Parent.DecalFlag textBox.Changed:Connect(function() local decalId = textBox.Text if tonumber(decalId) then imageLabel.Image = "rbxassetid://" .. decalId else imageLabel.Image = "" warn("Invalid Decal ID") end end) -- server script local ChangeDecalEvent = game:GetService("ReplicatedStorage").RemoteEvents:WaitForChild("ChangeDecalEvent") ChangeDecalEvent.OnServerEvent:Connect(function(player, userInput) local imageLabel = player.PlayerGui.CreateCountry.ActualCAC.DecalFlag local validInput = userInput:gsub("%D", "") if userInput == validInput and userInput ~= "" then local success, message = pcall(function() imageLabel.Image = "rbxassetid://"..userInput end) if not success then ChangeDecalEvent:FireClient(player, "Error 306: "..message) end else ChangeDecalEvent:FireClient(player, "Invalid input.") end end)