|
| 23 Mar 2017 04:05 AM |
Here's the code on the server's end...
Quick note, it doesn't print anything as well!
ChatEvent = game:GetService("ReplicatedStorage").ChatEvent:WaitForChild("Chat")
ChatEvent.OnServerEvent:connect(function(player, ChatText) for i,v in ipairs(game.Players:GetPlayers()) do local L10 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line10 local L9 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line9 local L8 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line8 local L7 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line7 local L6 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line6 local L5 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line5 local L4 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line4 local L3 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line3 local L2 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line2 local L1 = v.PlayerGui:WaitForChild("Status"):WaitForChild("ScrollingFrame").LocalScript.Chat.Line1
local filteredText = game.Chat:FilterStringAsync(ChatText, player,v) L10.Value = L9.Value print(filteredText) L9.Value = L8.Value L8.Value = L7.Value L7.Value = L6.Value L6.Value = L5.Value L5.Value = L4.Value L4.Value = L3.Value L3.Value = L2.Value L2.Value = L1.Value L1.Value = player.Name.."["..player.Stats.Level.Value.."]: "..filteredText print(L1.Value) end end)
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 04:07 AM |
for i,v in ipairs(game.Players:GetPlayers()) do
R$0 |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 04:07 AM |
Isn't it pairs not ipairs?
R$79,850 |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 04:10 AM |
I think there isn't a difference as far as I know. I also tried it with just pairs for good measure but it still won't do anything.
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
Iriesoja
|
  |
| Joined: 28 Jan 2011 |
| Total Posts: 993 |
|
|
| 23 Mar 2017 04:14 AM |
ipairs stops when it finds a nil value
|
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 23 Mar 2017 04:16 AM |
pairs() allows iteration over key-value pairs. ipairs() allows iteration over index-value pairs, where the key is a number.
Use ipairs() when you want to return a table with numeric keys in proper order.
Don't use ipairs() on tables with keys that are not integers. It won't work. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 04:18 AM |
Oh okay that makes sense, thankyou.
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 04:25 AM |
Well I fixed the problem. Thanks for the help with ipairs and pairs though!
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
| |
|