How do i stop this function from "duplicating" each time i call it?

local function GetApi(API)
	local APIEvent = game.ReplicatedStorage:WaitForChild("Send/ReciveAPIS")
	APIEvent:FireServer(API)
	
	APIEvent.OnClientEvent:Connect(function(DataTable)
		for i, v in DataTable do
			PrintTo("Normal", i.." = "..v)
		end
	end)
end

Each time i call this function it does the right thing, but then when i call it again it does it twice, then 4 times, the 8 times…
I had this issue before but i cant get it to work in this situation

1 Like

i fixed it by putting the function outside the other function

2 Likes

That’s what i was going to say lol

1 Like

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