I'm making a makeshift chat system that allows Xbox players to chat, but through the Developer console and by Print() since I'm too lazy to script a whole UI and all of the UI scripting.
(Just note that I'm somewhat new to RemoteEvents/RemoteFunctions)
I have a remoteEvent located in game:GetService('ReplicatedStorage') that fires to all clients with the player's name and the text that they want to send. Here I have a Server script that gets executed when you hit the Send button...
local btn = script.Parent local cooldown = false btn.MouseButton1Down:Connect(function() if cooldown == false then cooldown = true local RS = game:GetService("ReplicatedStorage") local RF = RS.Stuff.Remotes.SendMessageE local playerName = script.Parent.Parent.Parent.Parent.Parent.Name local inp = script.Parent.Parent.Frame.TextBox.Text RF:FireAllClients(playerName, inp) wait(5) cooldown = false elseif cooldown == true then warn("Please wait before sending another message.") end end)
The "playerName" will be the sender's name, and the "inp" will be the input from the TextBox.
Then, I have a LocalScript in the same path as the Server script (underneath the "Send" button) containing the following script...
local RS = game:GetService("ReplicatedStorage") local RE = RS.Stuff.Remotes:WaitForChild("SendMessageE") RE.OnClientEvent:Connect(function(playerName, inp) print(tostring(playerName).." : "..tostring(inp)) end)
It should print out like this... [Timestamp] -- SenderNameExample : Hello!
But it ends up being this... [Timestamp] -- SenderNameExample : <-- No text at all, only the name and timestamp.
Any help please? I'm not gonna be on for a while because It's waayyy to late for me.