I have made a placement system and, it works to place. However, when I do place for the second time the function below fires two times. And so on if I place the third time It fires the function 3 times.
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if placingStructure == true then
if goodToPlace == true then
local StructureCFrame = clientStructure.CFrame
placedStructure = PlaceStructure:InvokeServer(clientStructure.Name, StructureCFrame)
AddToNumberValue:FireServer(clientStructure.Name)
if placedStructure == true then
placingStructure = false
clientStructure:Destroy()
StructureFrame.Visible = true
end
end
end
end
end)

1 comment
is this function inside another function by any chance?