我一直在一个称为Roblox的平台上制作游戏,并制作了一个简单的LocalScript脚本,该脚本可在加入后起作用。它将BillboardGUI放置在玩家的头顶上,说明leaderstats,但是无论何时玩家死亡,开销广告牌GUI都会消失。
我尝试过 •将其托管在服务器而非客户端上 •使用Humanoid.Died
local cashTag = script:WaitForChild("CashTag")
local player = game.Players.LocalPlayer
repeat
wait()
until player and player.Character
local ct = cashTag:Clone()
ct.CashText.Visible = true
ct.Parent = game.Players.LocalPlayer.Character:WaitForChild("Head")
ct.CashText.Text = "Candy: $" .. tostring(player.leaderstats.Candy.Value)
player.leaderstats.Candy.Changed:Connect(function()
ct.CashText.Text = "Candy: $" ..
tostring(player.leaderstats.Candy.Value)
end)
我希望它能将BillboardGUI放在头上,但它不会这么做