Need help with increasing text value with proximity prompt

so i’ve been working on a project that have a code where everytime i plant a tree it will increase a text value by 1. And the problem is the text won’t update on the client side it will only update the text on the server side.


this is the client side

and this is the server side

local tree1 = game.ReplicatedFirst.Tree1
local test1 = game.Workspace.prompt1
local ValueGui = game.StarterGui.PlantGUI.PlantText.Value
local value = 0


local function updateValueGui()
	ValueGui.Text = tostring(value) .. "/10"
	print("Updated ValueGui:", ValueGui.Text)
end


script.Parent.Triggered:Connect(function()
	test1:Destroy()
	tree1.Parent = workspace
	value = value + 1 
	print("Value increased to:", value) 


	updateValueGui()
end)


updateValueGui()

and this is the script

and i put this script in the proximity prompt. So i hope somebody could help me with it!

1 Like

When a player joins, Gui is copied from starterGui and pasted in Players > [username] > PlayerGui so you will need to update it in that folder for every player instead of updating starterGui.

Ahh i see so i should put that script in the playerGui or the gui that i put in the starterGui?