【问题标题】:Why is this script not working as it should?为什么这个脚本不能正常工作?
【发布时间】:2023-02-20 22:54:59
【问题描述】:

我正在尝试编写一个脚本,每次更改时打印一个 NumValue 的值。

我试过:

local Shards = workspace.ads.Amarelo.Shards
local ShardsValue = workspace.ads.Amarelo.Shards.Value
local plr = game.Players.LocalPlayer

function update()
local newValue = ShardsValue
print(newValue)

end
update()

Shards.Changed:Connect(function()
update()
end)

但即使值是另一个数字,它也会一直打印 me 0

【问题讨论】:

    标签: lua roblox


    【解决方案1】:

    尝试将连接函数更改为类似的东西,看看它是否会打印新值。

    Shards.Changed:Connect(function(newValue)
    print(newValue)
    end)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-30
      相关资源
      最近更新 更多