Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why Is My script not detecting a int value change?

local health = script.Parent.Stats:WaitForChild("Health")
local maxHealth = health.Parent:WaitForChild("MaxHealth")
local text = script.Parent.BillboardGui:WaitForChild("TextLabel")

health.Changed:Connect(function()
	if health <= 0 then script.Parent:Destroy()
	else
		text.Text = health.Value .. " / " .. maxHealth.Value
	end
end)

that is the script (ITS IN A SERVER SCRIPT) https://i.imgur.com/aOzwgRy.png ^^^that is the part that its in this is in workspace so when i change the int value the text does not change i tried using prints but they dont print anything

1 comment

0

try localplayer if its in local script

1 answer

Fixed it if i change it it only local i have to change it using a script

This discussion is preserved as it was. New answers, comments, and votes are closed.