Hi! I’m MAC, and I’m experiencing a few issues:
When the remote event is fired from the client to the server, it repeats for each in-game player.
No solutions found.
Please reply if you can help me!! : - )
Hi! I’m MAC, and I’m experiencing a few issues:
When the remote event is fired from the client to the server, it repeats for each in-game player.
No solutions found.
Please reply if you can help me!! : - )
Can we see the code please so we can help you?
Nevermind, LOL. Deepest apologies though.
You were connecting the client.Chatted event each time the client types a character. You end up with many connections triggering all at once when client hits enter
local client = game.Players.LocalPlayer
local Chatted = false
local chat_box = client.PlayerGui.Chat:FindFirstChild("ChatBar", true)
local old_text = chat_box.Text
chat_box:GetPropertyChangedSignal("Text"):Connect(function()
local new_text = chat_box.Text
if #new_text > #old_text then
print("true")
Chatted = true
end
old_text = new_text
end)
--[[ This should be outside the ChangedSignal event, Connect it only ONCE
not everytime that client types a character ]]
client.Chatted:Connect(function(Message)
print("do")
if Chatted == true then
Chatted = false
game:GetService("ReplicatedStorage").Handle:FireServer(Message)
end
end)