How to edit other player "PlayerGUI" with local script

I get this error when I try to test it. Does it need to be onClienEvent?
image

Did you put the code in a script inside SeverScriptService?

It’s suppossed to be OnServerEvent. You put the server code in a LocalScript.

Oh, I accidently put it inside of local script. My bad

Also remember that you should filter the problem text, since the user can write anything they want in there, and then show it to another player. In studio, text does not filter. You will only be able to tell if it’s filtering correctly ingame.

That’s what I thought. I will make a log of sent cards later

You can easily filter the text using this documentation.

Error comes out on client that receives card. Also I’m very sorry that I ask alot, I’m new to proggraming
image

Error goes to this script

local send = script.Parent.Send

local patientName = script.Parent.PatientName

local patientProblem = script.Parent.PatientProblem

local player = game.Players.LocalPlayer

local RS = game:GetService("ReplicatedStorage")

send.MouseButton1Click:Connect(function()
	RS.PlayerCardSubmited:FireServer({
		Reciever = patientName.Text,
		Problem = patientProblem.Text,
	})
end)

RS.PlayerCardSubmited.OnClientEvent:Connect(function(info, sender)
	if sender ~= player then
		player.PlayerGui:WaitForChild("PatientCard").Frame.PatientProblemSystem.Text = info.Problem
		player.PlayerGui.PatientCard.Frame.PatientName.Text = player.Name
		player.PlayerGui.PatientCard.Frame.CardSent.Text = sender.Name
		player.PlayerGui.PatientCard.Enabled = true
	end
end)

Line 20

Oh, on line 20 switch this: info.Problem to this: problem.

1 Like

Also change the ‘info’ argument in the event to ‘problem’.

1 Like

Try doing:

RS.PlayerCardSubmited.OnClientEvent:Connect(function(info, problem, sender)
1 Like

Thank you both its working now :smiley: I been working on this for 3 weeks. THANKS SO MUCCCH

1 Like

yea i sse it, i was typing when u say

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