|
| 23 May 2015 03:13 PM |
My game(which is a MASSIVE work-in-progress) has a custom chat system. It doesn't seem to work outside of studio. I have filtering enabled and I am wondering about that. Here is the server-side script: script.Chatted.OnServerEvent:connect(function(player, msg) broadcast(player.Name..":"..msg) end) function broadcast(msg) addChat(msg, game.StarterGui.Chat) for l, p in pairs(game.Players:GetChildren()) do addChat(msg, p.PlayerGui.Chat) end end function addChat(msg, obj) obj.ChatFrame.Line0.Text = obj.ChatFrame.Line1.Text obj.ChatFrame.Line1.Text = obj.ChatFrame.Line2.Text obj.ChatFrame.Line2.Text = obj.ChatFrame.Line3.Text obj.ChatFrame.Line3.Text = obj.ChatFrame.Line4.Text obj.ChatFrame.Line4.Text = obj.ChatFrame.Line5.Text obj.ChatFrame.Line5.Text = obj.ChatFrame.Line6.Text obj.ChatFrame.Line6.Text = obj.ChatFrame.Line7.Text obj.ChatFrame.Line7.Text = obj.ChatFrame.Line8.Text obj.ChatFrame.Line8.Text = msg end And here is the caller of the RemoteEvent: game.ServerScriptService.ServerChat.Chatted:FireServer(script.Parent.Input.Text) |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 03:17 PM |
There is a way to up the efficiency of the code; however, to answer your question, I would recommend using a RemoteFunction. It's my understanding you're trying to yield or return something.
-𝒩 | Anticodist, Scripter |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 03:19 PM |
| I don't want to yield or return anything actually. I just want it to pass an argument from a server script from a client script. |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 03:19 PM |
| And I don't want to make it more efficient yet. I am going to make MAJOR changes. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 23 May 2015 03:51 PM |
Anticodist I suggest you stop using FE (if you do) since it's clear you have no idea what the hel you're doing
OP any GUIs that aren't created on the server (this includes GUIs in StarterGui) won't be accessible in server scripts |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 05:13 PM |
| @above That was unhelpful and unnecessary. |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 05:15 PM |
| I help two people and I'm unhelpful? |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 05:18 PM |
BothAngels:"Anticodist I suggest you stop using FE (if you do) since it's clear you have no idea what the hel you're doing" Wiki:"A sound way to prevent exploits is to turn on FilteringEnabled in your Workspace's properties." |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 05:26 PM |
He should learn when to use RemoteFunctions and why r u still here i already helped u lol |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 May 2015 05:32 PM |
| Read the second part of my unhelpful post |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 05:36 PM |
I just read this thread. You should learn how to take people's advice.
-𝒩 | Anticodist, Scripter |
|
|
| Report Abuse |
|
|