Hi! I’m unsure how to go forward with this code. The script in question is part of a larger settings menu GUI and unfortunately any time it’s ticked is not working in the slightest. I’m not very experienced when it comes to scripting and would appreciate any help at all. I’ve tried multiple solutions but unfortunately cannot seem to link the GUI setup and the script. Attached is a screenshot of the GUI setup and the code that is giving me trouble.
local Players = game.Players
local module = {}
module.ToggleNames = function(bool)
Hide = bool
for _, player in pairs(Players:GetPlayers()) do
if player.Character then
local head = player.Character:FindFirstChild("Head")
if head and head:FindFirstChild("NameGui") then
head.PlayerDisplay.Enabled = not Hide
end
end
end
end
module.ToggleName = function(char)
local head = char:FindFirstChild("Head")
if head then
local display = head:FindFirstChild("NameGui")
if display then
display.Enabled = not Hide
end
end
end
return module
I’m assuming the problem lies in the part of the script that finds the GUI itself but am stumped on how to rewrite it. Again, any help at all would be appreciated. Thanks!