So I’m working on making a fake donation system for an admin panel that will put a chat message saying the user donated robux, but for some reason the message sends multiple times depending on how many people are in the server (1 person sends 1 time 2 people sends 2 times etc) and i have no idea how or why its happening.
Scripts:
--Local script inside button
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.GetLocalPlayer:FireServer()
end)
--Server script inside button
local Players = game:GetService("Players")
local RepStore = game.ReplicatedStorage
game.ReplicatedStorage.GetLocalPlayer.OnServerEvent:Connect(function(Player)
RepStore.BoughtEvent1:FireAllClients(Player)
end)
--Local script inside StarterCharacterScripts
local TCS = game:GetService("TextChatService")
local RepStore = game.ReplicatedStorage
RepStore.BoughtEvent1.OnClientEvent:Connect(function(player)
local msg = TCS.TextChannels.RBXGeneral:DisplaySystemMessage(`<font color='{"#00ff44"}'>{"5 robux donation has been purchased by "..player.Name}</font>`)
end)
any solutions would be super helpful ^^ Thanks!