Gui text not changing from script

Hello! I’m pretty new here so this is my first post. I’m making a simulator game with my friends and its going pretty well. I just made a currency system with leaderstats. I thought that i would make a different way to see your money for players who are on a mobile device. I made the gui and coded the script but when i test the game the text does not change. If i look in the properties tab the text IS what i want it to be but its not working in the actual game. Here’s my script:

script.parent.Touched:Connect(function(parttouched)
print(parttouched)
game.Workspace.Cash.Playing = true
local player =  parttouched.Parent.Name
local Mud = game.Players[player].leaderstats.Mud.Value
local cash = game.Players[player].leaderstats.Coins.Value
cash = cash + Mud
Mud = 0
game.Players[player].leaderstats.Mud.Value = Mud
game.Players[player].leaderstats.Coins.Value = cash
game.StarterGui.gui.moneydisplay.Text = (cash)

end)

StarterGui is a placeholder for GUIs when you are editing in studio. If you want to edit a GUI you have to use the GUI Folder that is in the Player Instance inside of Players.

1 Like

Ohhhhhhh… Thank you! Ill try this right now! Thanks for quick reply! :smiley: