无论如何,即使我更改客户端上的文本,也不会打印。我不知道该怎么办,开发论坛没有帮助。 我尝试了所有不同的方法来检测它,但它们都没有起作用。我希望它至少可以检测到我何时更改文本,但没有。我不知道该怎么办。
localscripts在工作区中不执行。根据文献
,
在这里是localscript执行的列表::
startergui StarterPlayerScripts
标准章 ReplicatedFirstlocal surfaceGui = game.Workspace.pathToYourSurfaceGui.SurfaceGui
local textBox = surfaceGui.TextBox
textBox:GetPropertyChangedSignal("Text"):Connect(function()
print(textBox.Text)
end)
Object.GetPropertyChangedSignal
检测文本框文本属性的更改。另外,您可以使用
Changed
如果更改的唯一属性是
Text
Instance.GetStyledPropertyChangedSignal
不用于检测文本更改。这用于检测基于样式的更改(阅读更多有关这些信号
HERE的更多信息)。下面显示了聆听基于文本更改的正确方法以供参考
-- not styled property
script.Parent:GetPropertyChangedSignal("Text"):Connect(cb)
端,尝试
Instance.Changed
::
-- given only the text property changes
script.Parent.Changed:Connect(print)