The text is updating but not showing it on screen.
script.Parent.Touched:Connect(function(hit) if hit.Name == "Collectable" then game.Workspace.Money.Value = game.Workspace.Money.Value + hit.Value.Value game.StarterGui.ScreenGui.TextLabel.Text = "Money: "..game.Workspace.Money.Value hit:Destroy() end end)
You should be using a LocalScript and accessing the PlayerGui
:
script.Parent.Touched:Connect(function(hit) local plr = game.Players.LocalPlayer if hit.Name == "Collectable" then game.Workspace.Money.Value = game.Workspace.Money.Value + hit.Value.Value plr.PlayerGui.ScreenGui.TextLabel.Text = "Money: "..game.Workspace.Money.Value hit:Destroy() end end)
If you want to access the PlayerGui
from a normal script, learn how to use RemoteEvents
. (Despite this, there is a bug that enables you to access the PlayerGui through a normal script without using RemoteEvents. Why? I have no idea.)