Hi everyone,
I was reading a question on "why my text label is not updating", but when I was reading the code written by the answerer, I came across **
in his code (see below). Please tell me what he means by this.
local Players = game:GetService("Players") function onPlayerAdded(player) local Money = Instance.new("IntValue") Money.Name = "Coins" Money.Value = 166 if player.PlayerGui:FindFIrstChild("ScreenGui") then -- this line isn't needed. player.PlayerGui.**.ScreenGui.CoinAmount.Text = Money.Value end end --When a player joins, call the onPlayerAdded function Players.PlayerAdded:connect(onPlayerAdded) --Call onPlayerAdded for each player already in the game for _,player in pairs(Players:GetPlayers()) do onPlayerAdded(player) end
(This code was written by superhudhayfa)
Thanks, FD284
The * symbol is just an arithmetic operator
As for why that is there, I have no idea. Judging from line 7, you can just change line 8 to
player.PlayerGui.ScreenGui.CoinAmount.Text = Money.Value
And speaking of line 7, there is a typo. It's "FindFirstChild" not "FindFIrstChild", just a simple mistake.