I want to update the GUI whenever the players money changes.
local gui = script.Parent
local text = gui.Dosh.Text
local player = gui.Parent.Parent.Parent
local dosh = player:WaitForChild("Dosh")
dosh.Changed:Connect(function()
print("working")
text = dosh.Value
end)
This is the script I am using to try and make this work.
However, the text does not update whenever the player’s money changes, and there are no errors.
local Player = game.Players.LocalPlayer -- Get player like this instead
local PlayerDosh = Player:WaitForChild("Dosh")
local DoshDisplay = script.Parent:WaitForChild("Dosh")
PlayerDosh:GetPropertyChangedSignal("Value"):Connect(function()
DoshDisplay.Text = PlayerDosh.Value -- Change properties like this
end)
(i forgot to rename Dosh → PlayerDosh if you already copied)
remove .Changed
i wrote it on the website pretty quickly
local Player = game.Players.LocalPlayer -- Get player like this instead
local PlayerDosh = Player:WaitForChild("Dosh")
local DoshDisplay = script.Parent:WaitForChild("Dosh")
PlayerDosh:GetPropertyChangedSignal("Value"):Connect(function()
DoshDisplay.Text = PlayerDosh.Value -- Change properties like this
end)