Chat message appears more than once (Solved)

when you buy a devproduct it will fire a remote event that will make a chat message appear in chat (im using legacy chat) but when i buy it again it does 2 messages rather than one then 4 and then 8 and so on and i dont know why its doing that

when i buy the product it should have one chat message in chat. instead the first time i buy it it displays 1 message like normal. then i buy it again and theres 2 more messages instead of just one more. then again and 4 more messages.

any idea why and whoever solves gets solution 100% guaranteed no joke

Can i see the script Please?


it is only 1 or is duplicating all the messages?

all products duplicate the messages its not just 1

1 Like

probably should have made that script shorter for the purpose of this

the actual products work so feel free to use them if you want

1 Like

Hmmm, im relatively new at this (i think i can be named as intermediate) but I don’t work much on that kind of stuff, and I’m not very familiar with that, sorry.
But i can be one thing, do you have any loops in the server or local scripts?

no not that im aware of char char

for _, player in ipairs(game.Players:GetPlayers()) do

		if player ~= Player then

			player.Character:BreakJoints()
			
			RemoteEvent:FireAllClients(Player.Name)

		end

	end

What you’re doing right now is iterating over everyone in the server and each iteration you fire the remote event to everyone. You should either move RemoteEvent:FireAllClients(Player.Name) outside of the for loop or use RemoteEvent:FireClient(player, Player.Name) instead. Although I don’t think this would resolve the issue you described originally, it is an issue that will pop up with more than a single person in a server.

2 Likes

still have the same problem but thank you @red4erik you solved another issue i was having

like i said it makes 1 chat message the first time, 2 the second, 3 the third when its only suppose to make 1 chat message every time you buy it

i fixed the issue

make sure to put return true at the end of every product

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.