Hi! i am trying to find a way to show the amount of money player has just as soon as he joins.
but i keep getting an error saying “BaseGui is not a part of PlayerGui” (BaseGui is the name of my screenGui) i even used a findfirstchild to wait for the basegui to load but it did not work.
here is the script:
game.Players.PlayerAdded:Connect(function(plr)
local data = Instance.new("Folder", plr)
data.Name = "data"
local playerhassword = Instance.new("IntValue", data) -- Create a score variable
playerhassword.Name = "playerhassword" -- Name
playerhassword.Value = 0 -- Initial Value
local cash = Instance.new("IntValue", data)
cash.Name = "cash"
cash.Value = 100
local BaseGUI = game:WaitForChild("StarterGui"):WaitForChild("BaseGUI")
if BaseGUI then
plr.PlayerGui.BaseGUI.Money.Text = plr.data.cash.Value .. "$"
end
end)
my problem is in this part of the script:
local BaseGUI = game:WaitForChild("StarterGui"):WaitForChild("BaseGUI")
if BaseGUI then
plr.PlayerGui.BaseGUI.Money.Text = plr.data.cash.Value .. "$"
end