Trying to make a phone messaging script, the message sent is "nil"

Trying to make a phone script the message returned to the reciever is “nil”

External Media

I did prints, the text is there. until you set the textlabels text

I am not sure what is supposed to be script.Parent.Parent.Name and why you use a string.lower on it to find the player instance because if the player name has uppercase letters, you will never find the player instance.

You get nil, and it’s normal. The first argument when you call FireClient isn’t an argument but the client to fire the event to, like precised on the documentation. Everything else is the arguments sent. So in your case, you sent lowerstring and txt . So when you do:

event.OnClientEvent:Connect(function(plr, lowerstring, text)

The result is this:
plr = lowercase
lowerstring = txt
text = nil

You just need to remove plr.

event.OnClientEvent:Connect(function(lowerstring, text)

You can also do this:

event.OnClientEvent:Connect(function(plr, lowerstring, text)
	print(plr, lowerstring, text)

To realize what’s the issue.

Hope I’ve helped. If you have any questions, please don’t hesitate to ask.

1 Like

Nevermind, sorry, I was wrong. I forgot that they used FireClient and not FireAllClients.

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