This script tries to update a GUI so it shows the correct amount of money in your wallet. However, it pulls out this error:
Variables is not a valid member of PlayerScripts
Here's how the player looks when you spawn. https://i.gyazo.com/762eb98620557f8ace39012bd6e55833.png
Now here's the code for the previously mentioned GUI.
--Excuse the inefficiency with the two functions
function changed()
script.Parent.Text = "Wallet: " ..script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.Variables.Gold.Value.. "/" ..script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.Variables.MaxGold.Value
end
script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.Variables.Gold.Changed:connect(changed)
function changed2()
script.Parent.Text = "Wallet: " ..script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.Variables.Gold.Value.. "/" ..script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.Variables.MaxGold.Value
end
wait(5)
script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.Variables.Gold.Changed:connect(changed)
script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.Variables.MaxGold.Changed:connect(changed2)
In case that still hasn't convinced you this script should work, here's how the player's PlayerGui looks.
https://i.gyazo.com/276b42a9c83a71545ec2cef074c31d27.png
I'm really stumped on this, because Variables is spelled the same each time and apparently it isn't a member of PlayerScripts.

1 comment
It worked! Thanks for helping and for the less messy code.