【发布时间】:2020-07-02 02:38:34
【问题描述】:
我正在努力在 ROBLOX 中创建一个播放器 GUI。 GUI 应该显示玩家的钱,可悲的是,当我测试它并尝试更新玩家的硬币时,GUI 不会随之更新。我添加了一个旧代码,因为它适用于我正在使用不同语言处理的旧项目。当我添加它时,我真的不知道我在想什么。
代码如下:
local player = game.Players.LocalPlayer
coinAmount = player:WaitForChild("leaderstats"):WaitForChild("Coins")
oldCoinAmount = player:WaitForChild("leaderstats"):WaitForChild("Coins")
text = script.Parent
if coinAmount ~= oldCoinAmount then
text = oldCoinAmount
end
我在想也许有办法不断刷新脚本,但我不知道如何。
此外,此 LocalScript 是实际 GUI 的子代 它也不会抛出任何错误。
【问题讨论】:
标签: user-interface text lua roblox