I'm trying to get my humanoid's health into a variable so i can put it into a text box.
snailhealth = game.Workspace.snail.Humanoid.Health
but here's the issue... It keeps returning nil.
Hello! I dunno how much experience you got in scripting and UI work, but I'm bad in UI work. So I mostly search for videos how to do it, and maybe edit it how I like it. I often use videos like this: https://www.youtube.com/watch?v=5J75rouuh7A Of course you don't have to do it 1:1 by him but you could get some inspiration's to the solutions there!. Wish ya a great day!
local snailhealth =Workspace:WaitForChild("snail"):WaitForChild("Humanoid").Health
Happens to me many times. What I would do is, when changing the health, you should directly call it, like this.
Humanoid.Health = 100
Using a variable on Humanoid does some strange stuff. I personally wouldn't assign a variable to a Humanoid attribute.
Closed as Non-Descriptive by JesseSong
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?