LocalScript not making GUI appear

For some reason nothing is printing. I’ve made plenty of debugging parts. But not a single thing was printed. This is a Local Script, this is the object structure.
image

local function printDebug(msg)
	print("[Debug]", msg)
end

local player = game.Players.LocalPlayer
printDebug("Got local player") 

local playerGui = player:WaitForChild("PlayerGui")
printDebug("Got playerGui")

local medGui = playerGui:WaitForChild("MedGUI") 
printDebug("Got medGui")

local symptoms = {
	"Heavy Bleeding",
	"Light Bleeding",
	"Major Pain", 
	"Light Pain"
}

script.Parent.Parent.Help.Triggered:Connect(function()

	printDebug("Help trigger started")

	local numIssues = math.random(1, 5)

	printDebug("Generating " .. numIssues .. " issues")

	local issues = medGui:WaitForChild("Issues")
	issues.Visible = true

	printDebug("Made issues frame visible")

	for i = 1, numIssues do

		local issue = issues:WaitForChild("Issue"..i)  
		issue.Visible = true

		printDebug("Made issue " .. i .. " visible")

		local symptom = symptoms[math.random(1, #symptoms)]
		issue.Text = symptom

		printDebug("Set issue " .. i .. " text: " .. symptom)

	end

	printDebug("Done showing issues UI")

end)
2 Likes

Is this a LocalScript under the workspace? If that’s the case, well, LocalScripts don’t work under the workspace.

2 Likes

It’s not directly under the workspace.


That’s the full object structure.

2 Likes

Localscripts don’t work at all in the workspace even if it’s inside something.

2 Likes

Hey, localscripts cannot run under workspace. For what you’re trying to do, use a server Script, then add a connection on the ProximityPrompt for Triggered. It will pass 1 argument, the Player who triggered.

3 Likes

Hi, local scripts are unable to run in the workspace

Local scripts should be in starter player, or starter gui

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