代码在说 "Attempt to compare number <= Instance"
Code Is Saying "Attempt to compare number <= Instance"
它说
Players.ninjafox56.PlayerGui.Shop.ShopGui.LightSide.ChooseSideL:5: attempt to compare number <= Instance
Rank = game.Players.LocalPlayer.leaderstats.Rank
Power = game.Players.LocalPlayer.leaderstats.Power
if Power >= 10000 then
Rank.Value = 'Light'
else
script.Parent.Text = 'Not Enough Power'
wait(3)
script.Parent.Text = 'Light Side'
end
end)
因为 Power
是 leaderstats
中的一个对象,我假设它是一个 NumberValue.
当你说
if Power >= 10000 then
您在比较中比较的是 NumberValue Instance against the number. You are not comparing the number stored inside Power
to the number, that's where your error is coming from. To fix this, use the NumberValue's Value:
if Power.Value >= 10000 then
它说
Players.ninjafox56.PlayerGui.Shop.ShopGui.LightSide.ChooseSideL:5: attempt to compare number <= Instance
Rank = game.Players.LocalPlayer.leaderstats.Rank
Power = game.Players.LocalPlayer.leaderstats.Power
if Power >= 10000 then
Rank.Value = 'Light'
else
script.Parent.Text = 'Not Enough Power'
wait(3)
script.Parent.Text = 'Light Side'
end
end)
因为 Power
是 leaderstats
中的一个对象,我假设它是一个 NumberValue.
当你说
if Power >= 10000 then
您在比较中比较的是 NumberValue Instance against the number. You are not comparing the number stored inside Power
to the number, that's where your error is coming from. To fix this, use the NumberValue's Value:
if Power.Value >= 10000 then