Text changing in propreties but not visually?

I am making a text box to show how many calories are missing when you cant buy something, but it doesnt change the text, BUT in the propreties it does for some reason

heres what the propreties and the buttons look like

My code just updates the Text’s text and idk how else to fix this

Yeah, your changing the text in Starter Gui, not in the gui of the player.
Use a local script like:

local player = game.Players.LocalPlayer

local gui = player.PlayerGui:FindFirstChild("yourguiname")
if gui then
	gui.(ur location of the text).Text = ecc
end

Fixed sorry.
Question: Are you checking the properties in StarterGui or in the player gui( Players → PlayerGui.(your screen))

no i am not, i think, here is one of the scripts i use to update it if it helps

local player = game.Players.LocalPlayer
local gui = player.PlayerGui:FindFirstChild("Text")
local info = gui:FindFirstChild("Missing")
local function onClick()
	local Players = game:GetService("Players")
	local player = Players.LocalPlayer
	local calories = player:WaitForChild("leaderstats").CaloriesBurned.Value
	local UP1 = player:WaitForChild("Hidden").UP1.Value

	local requiredCalories = {
--a table here
	if requiredCalories[UP1] then
		if calories >= requiredCalories[UP1] then
			calories = calories - requiredCalories[UP1]
			if UP1 == 13 or UP1 == 25 or UP1 == 30 or UP1 == 35 then
				UP1 += 5
			elseif UP1 == 14 or UP1 == 19 then
				UP1 += 3
			else
				UP1 += 1
			end
		else
			--make this change info's text to show how many calories you need to upgrade
			info.Text = "Missing " .. requiredCalories[UP1] - calories .. " calories"
		end
	elseif UP1 == 40 then
		info.Text = "Max Upgrade"
	end

	game.ReplicatedStorage.Values:FireServer(player.leaderstats.CaloriesBurned, calories)
	game.ReplicatedStorage.Values:FireServer(player.Hidden.UP1, UP1)
end

script.Parent.MouseButton1Click:Connect(onClick)

this was using your fix and it worked thank you

1 Like

If solved you can mark the discussion solved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.