You can write your topic however you want, but you need to answer these questions:
So I have been playing around, and I wanted to make a Base64 Decoder. Though I fixed all the Output Errors, it won’t show the GUI. So I am not sure what to do.
- Here is the Code:
-- Wait for the LocalPlayer property to become available
repeat wait() until game.Players.LocalPlayer
-- Create the ScreenGui object and attach it to the player's PlayerGui
local gui = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
gui.Name = "Base64 Decoder GUI"
-- Create the TextBoxes and TextLabels
local EncodedLabel = Instance.new("TextLabel", gui)
EncodedLabel.Name = "EncodedLabel"
EncodedLabel.Position = UDim2.new(0.25, 0,0.067, 0)
EncodedLabel.Size = UDim2.new(0, 200,0, 50)
EncodedLabel.Text = "Encoded Text:"
EncodedLabel.TextSize = 18
EncodedLabel.TextColor3 = Color3.new(1, 1, 1)
EncodedLabel.BackgroundTransparency = 1
local EncodedText = Instance.new("TextBox", gui)
EncodedText.Name = "EncodedText"
EncodedText.Position = UDim2.new(0.249, 0,0.282, 0)
EncodedText.Size = UDim2.new(0, 200,0, 50)
EncodedText.Text = ""
EncodedText.TextSize = 18
EncodedText.TextColor3 = Color3.new(1, 1, 1)
EncodedText.BackgroundTransparency = 0.5
EncodedText.BackgroundColor3 = Color3.new(0, 0, 0)
local DecodedLabel = Instance.new("TextLabel", gui)
DecodedLabel.Name = "DecodedLabel"
DecodedLabel.Position = UDim2.new(0.25, 0,0.52, 0)
DecodedLabel.Size = UDim2.new(0, 200,0, 50)
DecodedLabel.Text = "Decoded Text:"
DecodedLabel.TextSize = 18
DecodedLabel.TextColor3 = Color3.new(1, 1, 1)
DecodedLabel.BackgroundTransparency = 1
local DecodedText = Instance.new("TextBox", gui)
DecodedText.Name = "DecodedText"
DecodedText.Position = UDim2.new(0.249, 0,0.755, 0)
DecodedText.Size = UDim2.new(0, 200,0, 50)
DecodedText.Text = ""
DecodedText.TextSize = 18
DecodedText.TextColor3 = Color3.new(1, 1, 1)
DecodedText.BackgroundTransparency = 0.5
DecodedText.BackgroundColor3 = Color3.new(0, 0, 0)
-- Define the decodeBase64() function
function decodeBase64(str)
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
str = str:gsub('[^'..b..'=]', '')
return (str:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(b:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string.char(c)
end))
end
-- Define the onTextChanged() function to handle changes to the EncodedText TextBox
function onTextChanged()
local encoded = EncodedText.Text
local decoded = decodeBase64(encoded)
DecodedText.Text = decoded
end
-- Connect the onTextChanged() function to the TextBox's TextChanged event
EncodedText.Changed:connect(onTextChanged)
Here is what Happens:
So any idea’s on what I am doing wrong?