Script assumes that humanoidrootpart is torso

Hello! As the title suggests, I have a script that checks for a billboard gui inside a torso and turns its Enabled on or off, depending if a player is nearby or not. However, when I tried the script, the script errored, saying that the billboard gui is not a child of the humanoidrootpart, not the torso. Why does this happen, and how can i fix it?

if Enemy and Enemy.Torso and Enemy.Torso:FindFirstChild("SoulStealGui") then v.Torso.SoulStealGui.Enabled = true end

Try adding print statements and if needed, add if statements to debug it

I’ve tried using print statements, but the script prints Torso when I put print(Enemy.Torso)

Your if statements checks for enemy torso not v but after ur if statement you use the variable v

oh yeah you’re right how did i not realise :skull: I changed it and tried testing it, but it caused the server to lag and crash, and I have no idea if it is because the script has issues or it is because roblox’s servers are having issues rn so I will test it later

Check which line of code has the error by looking at the console’s error message. You might be checking for HumanoidRootPart.SoulStealGui somewhere else on another line.

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