Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a server script retrieve input from a textbox without error?

Asked by 5 years ago

I'm making a server message script, here is the code:

local label = require(game.StarterGui.SM.Frame.message:WaitForChild('uhoh'))
local button = script.Parent
local box = script.Parent.Parent:WaitForChild('message')
button.MouseButton1Click:Connect(function()
    label()
    wait(5)
end)

I get the error "Attempted to call require with invalid argument(s)." How do I fix it?

0
game.StarterGui.SM.Frame.message:GetPropertyChangedSignal("Text"):Connect(function() print(game.StarterGui.SM.Frame.message.Text) end) royaltoe 5144 — 5y
0
sorry for lack of formatting there ^^ you can use GetPropertyChangedSignal to see when a property, such as text has changed. Didn't put the code as an answer because I am not sure if that is what you want royaltoe 5144 — 5y
0
Thanks! yes it is, put it is an answer if you want ^^ iiConstable_Subwayx 130 — 5y

Answer this question