Code I have so far:
game.Players.PlayerAdded:Connect(function() game.StarterGui:FindFirstChild("Money") if Money.Value == 0 then game.StarterGui.MoneyGUI.MoneyFrame.MoneyText.Text = ("'No world means NO MONEY!' -Mr. Krabs") elseif game.Players.Money > 0 then game.StarterGui.MoneyGUI.MoneyFrame.MoneyText.Text = game.Players.Money end end)
It doesn't work. It leaves the TextLabel (MoneyText) saying 'Label'. What am I doing wrong? Shouldn't its text change to 'No world means NO MONEY! -Mr Krabs'?
I'm a bit confused. You did Money.Value == 0
but on the second argument, you used game.Players.Money > 0
? On the second one, you are checking inside of the Player directory. And the StarterGui is the wrong directory. If you want to change a GUI text you need to change the one located in PlayerGui. Here's some code that should help you a bit.
game.Players.PlayerAdded:Connect(function(Player) local PlayerGui = Player:WaitForChild("PlayerGui") local Money = Player:WaitForChild("Money") local MoneyGUI = PlayerGui:WaitForChild("MoneyGUI") if Money.Value <= 0 then MoneyGUI.MoneyFrame.MoneyText.Text = ("'No world means NO MONEY!' -Mr. Krabs") else MoneyGUI.MoneyFrame.MoneyText.Text = Money.Value end end)
That won't automatically update though. And that is assuming the Money is located inside of the player and not in a different folder.