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!