I get this error when I try to test it. Does it need to be onClienEvent?
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
Error comes out on client that receives card. Also I’m very sorry that I ask alot, I’m new to proggraming
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
.
Also change the ‘info’ argument in the event to ‘problem’.
Try doing:
RS.PlayerCardSubmited.OnClientEvent:Connect(function(info, problem, sender)
Thank you both its working now I been working on this for 3 weeks. THANKS SO MUCCCH
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.