Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Is My script not detecting a int value change?

Asked by 3 years ago
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

0
try localplayer if its in local script stevenfury91 -17 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question