Script not running when textbox recieves and input

I’m trying to get the client to print the number inputted into the textbox

My issue is that it appears the script isn’t running when the textbox is updated

I’ve looked for solutions, I’ve even copied and pasted a script from another topic but it still doesn’t seem to work, any suggestions?

Here’s my script:

local generationSelection = game.StarterGui.ScreenGui.generationSelection
local textbox = generationSelection.textbox
local button = generationSelection.button

textbox:GetPropertyChangedSignal("Text"):Connect(function()
	textbox.Text = textbox.Text:gsub("%D","")
	print(textbox.Text)
end)

I’d also like to mention that I don’t want any characters other than numbers to pass through

is it a server script, if so make it local script

It is in fact a local script (why is the character minimum so long a)

Your using game.StarterGui, you should be using game.Players.LocalPlayer.PlayerGui

1 Like

Ahh, thanks! I’m relatively new to roblox and make that mistake quite often

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.