即使我看过很多帖子,排行榜也不起作用

问题描述 投票:0回答:1

我的排行榜

function Onplrjoined(plr)

local leaderstats = Instance.new("IntValue")
leaderstats.Parent = plr
leaderstats.Value = 0
leaderstats.Name = "leaderstats"

local stat = Instance.new("IntValue")
stat.Name = "Coins"
stat.Value = 0

结束

本地玩家 = 游戏:WaitForChild("玩家")

players.PlayerAdded:连接(Onplrjoined)

但是当我加入时它没有显示任何内容 当我加入时它没有显示任何内容

lua roblox
1个回答
0
投票

您忘记将

stat
对象放入leaderstats

这行代码很容易解决:

stat.Parent = leaderstats

哦,顺便说一句,使用

game:GetService("Players")
而不是
game:WaitForChild("Players")
,因为这样更干净

© www.soinside.com 2019 - 2024. All rights reserved.