Medical System not working

So simple medical system, proximity prompt trigger, server fires event, localscript should receive it and show a GUI, not sure why it’s not working.(No errors)
Serverscript:
image

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local event = Instance.new("RemoteEvent")
event.Name = "ShowMedicalIssues"
event.Parent = ReplicatedStorage

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

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

	-- Generate issues
	local numIssues = math.random(1,5)

	event:FireClient(player, numIssues)

	for i = 1, numIssues do

		local symptom = issues[math.random(1,#issues)]
		event:FireClient(player, symptom, i)

	end

end)

LocalScript:
image

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("ShowMedicalIssues")

local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local medGui = playerGui:WaitForChild("MedGui")

event.OnClientEvent:Connect(function(numIssues)

	-- Got number of issues
	print("Showing", numIssues, "issues")

	medGui.Issues.Visible = true

end)

event.OnClientEvent:Connect(function(symptom, issueNumber)

	-- Got symptom for individual issue  
	local issue = medGui.Issues:WaitForChild("Issue"..issueNumber)

	issue.Visible = true
	issue.Text = symptom

	print("Set " .. issueNumber .. " to " .. symptom)

end)

RemoteEvent gets created by the serverscript.

You’re connecting multiple .OnClientEvents so they’re most likely firing at the same time bugging something out. You can fix this by detecting the type of argument received.

LocalScript:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("ShowMedicalIssues")

local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local medGui = playerGui:WaitForChild("MedGui")

event.OnClientEvent:Connect(function(symptom, issueNumber)
	print("Recived")
	
	if type(symptom) == "number" then
		local numIssues = symptom
		
		-- Got number of issues
		print("Showing", numIssues, "issues")

		medGui.Issues.Visible = true
	else
		-- Got symptom for individual issue  
		local issue = medGui.Issues:WaitForChild("Issue"..issueNumber)
		issue.Visible = true
		issue.Text = symptom

		print("Set " .. issueNumber .. " to " .. symptom)
	end
end)

Where’s the medGui located?
Is there any warnings?

It’s not printing anything, so I think it’s something to do with the serverscript not properly firing the event.

Where is the medGui located? Is it actually inside of the player gui or is it inside of your script?

Under the NPC character

  • Help(ProximityPrompt)
    • MedicalSystem(Script)
      • MedGUI

You need the medGui to be in the PlayerGui for it to work.

How can I put it in playergui?

Drag it from the script into starterGui